-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Class as parameter #144
Class as parameter #144
Conversation
Although the PR is ok for me, I'm 👎 because of this issue. As |
@ste93cry yes that's the new way to customize class in Symfony. This PR is against a branch were all classes are customizable using a parameter so for consistency also When the maintainer decide to move to the new standard it can then change all classes. |
Class parameter are here for historical reason. Now the Symfony best practices recommends to not use this. And we follow them. AFAIK, if you really want to override the class, you can play with compiler passes for that. Otherwise, if you think this class can be overrided for good reason, you should propose something with configuration, not class parameter. Thanks for you contribution anyway. 😉 |
@soullivaneuh No they do not, or at least, not for libraries. Here is what is written at the top of the BP document :
|
@greg0ire https://symfony.com/doc/current/best_practices/business-logic.html#service-no-class-parameter
So indeed the top introduction talk about app for most of the cases, but on this one, third party bundles are concerned too. So we can close it. 😄 |
Missread the sentence indeed, this is wrongly adopted from the bundle. Anyway, I still think it's better to propose service id configuration than permit class override. As for |
Closing the PR then, since I tend to agree that this practice is indeed kind of shady. |
Changelog
Class for service
sonata.intl.locale_detector.request_stack
is now defined via parameters. This allow easier overitingSubject
Class for service RequestStackDetector defined via parameter