#101544Autoregister EventListener via PHP Attribute
Description
With Version 12 the autodetecting of the Event was introduced, but you still have to add the EventListener to your Service.yaml/Service.php file.
It would be nice to have a PHP-Attribute like #[EventListener] to autoregister it.
I think this could be easily archived be merging the classes of the attribute and the TaggedServiceIds (https://github.com/TYPO3/typo3/blob/5b6775e962aa455559146c1f29bb54a9fa4ba5a5/typo3/sysext/core/Classes/DependencyInjection/ListenerProviderPass.php#L78)
Reviews 5
- 13.4 87438[DOCS] Have a better example in event listener docs
- main 87436[DOCS] Have a better example in event listener docs
- main 80558[DOCS] Fix code examples for tagging event listeners with PHP attribute
- main 80386[FEATURE] Improve event listener registration
- main 80309[FEATURE] Introduce PHP attribute to autoconfigure event listeners