Project

General

Profile

Actions

Feature #101544

closed

Autoregister EventListener via PHP Attribute

Added by Sascha Nowak 9 months ago. Updated 3 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 #1

Updated by Sascha Nowak 9 months ago

  • Subject changed from Autoregister EventListener via PHP Annotation to Autoregister EventListener via PHP Attribute
Actions #2

Updated by Sascha Nowak 9 months ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review 9 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #4

Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #5

Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #6

Updated by Gerrit Code Review 9 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #7

Updated by Gerrit Code Review 9 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #8

Updated by Gerrit Code Review 9 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80309

Actions #9

Updated by Sascha Nowak 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Oliver Bartsch 9 months ago

Actions #11

Updated by Chris Müller 9 months ago

  • Related to Task #101693: Fix code examples for tagging event listeners with PHP attribute added
Actions #12

Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF