This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Update property generation for typed properties #14
Closed
camilledejoye
wants to merge
14
commits into
phpactor:master
from
camilledejoye:php7.4-handle-property-type
Closed
Update property generation for typed properties #14
camilledejoye
wants to merge
14
commits into
phpactor:master
from
camilledejoye:php7.4-handle-property-type
Commits on Dec 7, 2019
-
Always add property after traits & constants
I add this rule because when you create a new class and define a trait before creating a constructor (for example). When you create the constructor and you complete the attribute from it (transformation action) then the properties were added before the trait which was always a pain to correct manually.
Configuration menu - View commit details
-
Copy full SHA for 8c3f8ee - Browse repository at this point
Copy the full SHA 8c3f8eeView commit details -
Prepend a blank line when adding properties for the first time
Append a blank line before the propertiess to add if they are added after something else than the class's opening brace or another property.
Configuration menu - View commit details
-
Copy full SHA for eb7b2e9 - Browse repository at this point
Copy the full SHA eb7b2e9View commit details -
Move the new line before property with phpdoc in the template
Before we made a decision that if a property has a type it will have a phpdoc block because it was the only way to declare the type. I don't like this because this logic depends on the templates and don't have its place here anymore. So I removed it and added the blank line directly in the template if there is a phpdoc block. Plus it fix the issue when inserting multiple properties for the first time (no property in the class yet), then even if the properties have a type there were no blank line between the properties. Note: There is two cases where the blank line is a problem, when: - the property is inserted after the class's open brace - the is inserted after something else than the class's open brace or another property
Configuration menu - View commit details
-
Copy full SHA for db50fa7 - Browse repository at this point
Copy the full SHA db50fa7View commit details -
Append a blank line after the properties
Append a blank line but only when the first thing in the class is a method declaration. Otherwise there is already a blank line before the method declaration.
Configuration menu - View commit details
-
Copy full SHA for ae64a77 - Browse repository at this point
Copy the full SHA ae64a77View commit details -
Rename
lastProperty
intopreviousMember
It makes more sense and goes along with `nextMember` that was already used. We were already checking that `lastProperty` was an instance of `PropertyDeclaration` which proove that the name was not suited.
Configuration menu - View commit details
-
Copy full SHA for 8ebfe3a - Browse repository at this point
Copy the full SHA 8ebfe3aView commit details -
Initialize
nextMember
right awayReduce a bit the code and simply the loop. `reset()` return `false` if the array is empty, that's why I default it to `null`.
Configuration menu - View commit details
-
Copy full SHA for 78bc9a2 - Browse repository at this point
Copy the full SHA 78bc9a2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e89e90 - Browse repository at this point
Copy the full SHA 5e89e90View commit details -
Moving the blank line before a property in the template have created a few issue, as mentionied in the commit in question. This commit updates the unit tests to take those "side effects" into account.
Configuration menu - View commit details
-
Copy full SHA for fe335d2 - Browse repository at this point
Copy the full SHA fe335d2View commit details
Commits on Dec 14, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 5b105e8 - Browse repository at this point
Copy the full SHA 5b105e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 60f8881 - Browse repository at this point
Copy the full SHA 60f8881View commit details -
Configuration menu - View commit details
-
Copy full SHA for 798eda4 - Browse repository at this point
Copy the full SHA 798eda4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7580d42 - Browse repository at this point
Copy the full SHA 7580d42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d6785e - Browse repository at this point
Copy the full SHA 4d6785eView commit details -
Configuration menu - View commit details
-
Copy full SHA for a668a23 - Browse repository at this point
Copy the full SHA a668a23View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.