Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Apply attribute configurator to child classes#54365
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
src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Tests/Compiler/AttributeAutoconfigurationPassTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
2c896cb to2390a26Compare
chalasr left a comment
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.
Looks sensible to me. I'd suggest checking our current attribute list to make sure there's no blocker in extending each of them (and make those final if any, or hard-skip them)
src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
GromNaN commentedMar 21, 2024 • 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.
The list of autoconfigured attributes is in
|
chalasr commentedMar 22, 2024
The use case for |
GromNaN commentedMar 22, 2024
It will be also possible to remove the handling for all the symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php Lines 1108 to 1129 inbff8e08
|
GromNaN commentedMar 22, 2024 • 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.
All theinternal attributes can be extended and we already have aninternal use-case with Workflow attributes. Ready for review. |
b11cb5b to69dc71bComparefabpot commentedMar 23, 2024
Thank you@GromNaN. |
…Handler` (GromNaN)This PR was merged into the 7.1 branch.Discussion----------[Messenger] Allow extending attribute class `AsMessageHandler`| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| Issues | -| License | MITRevert#52971 which made `AsMessageHandler` final.Discussed in#54365 (comment)Commits-------9479563 Allow extending AsMessageHandler
…tener attributes (GromNaN)This PR was merged into the 7.1 branch.Discussion----------[FrameworkBundle] Remove custom handler for Workflow listener attributes| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | no| Deprecations? | no| Issues | -| License | MITAll the `Workflow\Attribute\As*Listener` classes extend `AsEventListener`. Since the attribute handler are now applied to child classes (#54365), it's no longer necessary to declare an attribute handler for each attribute.Discussed in#54365 (comment)Commits-------db7004c Remove custom handler for Workflow listener attributes
This allows extending attribute classes registered for autoconfiguration.
Use-case: Share configuration between several classes with pre-configured attribute classes. As described in#52898 (bus name for
AsMessageHandler, schedule name forAsCronTaskandAsPeriodicTask)The child-class attribute is handled by the same function as it's parent class that is registered for autoconfiguration. This means any additional property will be ignored (unless supported, which could be new feature for the
AsTaggedItemattribute configurator).If there is a configurator for the child class, the configurator for the parent class is not called.