-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
ObjectChoiceList closed for extension? #13459
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
Comments
Why cant you call the parent constructor with the property path you require from your inheriting class? |
I can, wouldn't that just be a workaround though? |
Doesnt seem like a workaround to me. |
@flip111 making everything protected is not about opening for extension. It is about opening for hacking by allowing to access all internal state. Calling the parent constructor is not a hack (avoiding to call a parent constructor could be considered as a hack as it might leave the class in a broken state) |
@stof in this particular case would it be a hack as well? If so i will close the issue. |
Its an optional argument, if you dont want to provide it you don't have to - as long as you still call the parent constructor. |
The Should be closed as fixed by #14050 imo. |
@flip111 I'll close this for now. If you'd like some other property visibility to be changed, please provide a justification (a use case). Thank you. |
https://github.com/symfony/Form/blob/master/Extension/Core/ChoiceList/ObjectChoiceList.php#L48
Why is this property set to private and not protected? I would like to use this property in my child class. Will access to this property modify the operation of the parent class too much? Not sure were this stands on the open/closed principle.
Thanks for support
The text was updated successfully, but these errors were encountered: