Project

General

Profile

Actions

Feature #101544

closed

Autoregister EventListener via PHP Attribute

Added by Sascha Nowak 10 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-08-03
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #101573: Improve event listener registrationClosedOliver Bartsch2023-08-04

Actions
Related to TYPO3 Core - Task #101693: Fix code examples for tagging event listeners with PHP attributeClosedChris Müller2023-08-15

Actions
Actions

Also available in: Atom PDF