Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Deprecate configuring tag names and service ids in compiler passes#40468
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
5e88f8e to71e66b1CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR was merged into the 4.4 branch.Discussion----------[Cache] fix test case name| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Should make#40468 green.Commits-------e2dffea [Translation] fix test case name
…or (andrew-demb)This PR was merged into the 5.3-dev branch.Discussion----------Use symfony/deprecation-contracts instead of trigger_error| Q | A| ------------- | ---| Branch? | 5.x| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->| License | MIT| Doc PR | - <!-- required for new features -->As `symfony/deprecation-contracts` added to requirements with PR#40468, we can update `trigger_error` call in favor reusing deprecation abstractionsCommits-------1acc296 Use symfony/deprecation-contracts instead of trigger_error
derrabus commentedMay 20, 2021
When resolving this deprecation, would you rather…
|
nicolas-grekas commentedMay 21, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
… inline all configurable strings |
…erListenersPass (derrabus)This PR was merged into the 5.4 branch.Discussion----------[EventDispatcher] Deprecate configuring tags on RegisterListenersPass| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | no| Deprecations? | yes| Tickets | N/A| License | MIT| Doc PR | N/AFollow-up to#40468.Commits-------2c4effe Deprecate configuring tags on RegisterListenersPass
Description-----------The `FragmentRendererPass` arguments have become deprecated insymfony/symfony#40468. Luckily, we don't actually need to use the compiler pass to get a list of services 😅Commits-------e10c533 Replace FragmentRendererPass with tagged locatorff626d6 CSd270e6e CS
Description-----------The `FragmentRendererPass` arguments have become deprecated insymfony/symfony#40468. Luckily, we don't actually need to use the compiler pass to get a list of services 😅Commits-------e10c5339 Replace FragmentRendererPass with tagged locatorff626d63 CSd270e6e7 CS
veewee commentedMar 25, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Looks like we are using it forcustom event listener tags in grumphp configuration@nicolas-grekas 👯 |
| publicfunction__construct(array$eventAliases,string$eventAliasesParameter ='event_dispatcher.event_aliases') | ||
| { | ||
| if (1 <\func_num_args()) { | ||
| trigger_deprecation('symfony/event-dispatcher','5.3','Configuring "%s" is deprecated.',__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.
It feels like it still can be configured with$eventAliases, what do you think about mentioning$eventAliasesParameter in the deprecation message?
donquixote commentedAug 5, 2023
For the record:
I think the tag name 'kernel.event_dispatcher' is not meant to imply that all the events are "kernel events", so this justification seems questionable in hindsight.
I think these customization options are typically not needed for projects that are built with symfony directly, but they can be useful for other frameworks or systems that use symfony classes and components selectively, instead of using symfony as a complete system. A good reason for custom tag names and service ids could be to avoid conflicts with other tag names and service ids from non-symfony components, or to have multiple instances of e.g. the event dispatcher - for whichever reason.
Or add another pass to rename the tag on each service that uses it - if we don't care if the old tag is restored afterwards. Still this is less clean than the parameter - but ok. To be clear: I am not necessarily requesting to revert this, I just want to give feedback on the "nobody uses this". |
Uh oh!
There was an error while loading.Please reload this page.
This PR is aimed at reducing the code complexity by hardcoding the name of tags and service ids that compiler passes have to deal with.
I think making these names configurable only adds boilerplate and maintenance overhead for no benefit:
Side note: I skipped updating changelog+upgrade files. This would be just noise to me (nobody uses this possibility anyway ;) )