-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
can access the field of a object through same name method #149
can access the field of a object through same name method #149
Conversation
A object in collection with private attribute, and accesor is a method which name is the same. Closure expression visitor can access value throught that metod if exists.
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.
This is a BC break, since this changes existing behaviour and allows accessing fields via accessor even though the author of the code may explicitly have deviated from the get$property
naming specifically to avoid this kind of implicit fetches.
I'm conflicted on whether this should actually be considered for inclusion...
I don't think so. The BC break would be preferring |
@alcaeus personally speaking, I do use this kind of accessor naming SPECIFICALLY to prevent tooling from auto-discovering it |
That sounds like there's a different problem going on, namely these tools being used when they shouldn't. IMO this is a valid access style for properties and shouldn't be used to "hide something from tooling", especially since the Symfony |
A object in collection with private attribute, and accesor is a method which name is the same. Closure expression visitor can access value throught that metod if exists.
Personally I made this request because is not strange that your entities define getters accessors at its private properties with a same name method. It's a convention that would be considered in order to get attributes values, and if you prefer I set in last order to be in mind... |
I write my accessors specifically as I'd say that we should deprecate the entire property access via getter instead, and rely only on state for lookups, which would remove the discussion in first place. Still, that is not for me to decide here, but I'm gonna close this PR as |
A object in collection with private attribute, and accesor is a method
which name is the same. Closure expression visitor can access value
throught that metod if exists.