New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prefix property starting with number with 'n' #584 #587
Conversation
@Korbeil could you please explain me how you re-generate all data for tests? |
Hey @Gounlaf, sure ! |
@Korbeil it should be OK now |
@@ -111,41 +111,41 @@ public function setTotalCount(int $totalCount) : self | |||
* | |||
* @return int | |||
*/ | |||
public function get1() : int | |||
public function getN1() : int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getters & setters should still be get1()
and set1()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I face this problem:
getName()
can't be used because it the original name of the property; one the side effect is, for property like "+1" and "-1" (in the github dataset), it's cleaned as "1"; it generate two getters/setters with the same name- using
getPhpName
, it contains the prefix. - I put the prefix with "n" in the
Naming
class to avoid do it in many places...
What should I do?
- doesn't apply the cleaning in
getPropertyName
? it will not be stored in and returned bygetPhpName
- or maybe add a new property on the
Property
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth having a new property on Property
class, one for properties and one for methods :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roger 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make Naming::cleaning()
public.
Thanks a lot for your contribution, could you add a note about it in the CHANGELOG file pls ? |
Yes. |
533910b
to
bb22447
Compare
Signed-off-by: Florian Levis <levis.florian@gmail.com>
Thanks again for this contribution ! |
No description provided.