Skip to content

Commit 042a3a3

Browse files
authored
Fixes listener documentation - #[AsListener] vs #[AsEventListener] (#6482)
1 parent 942e181 commit 042a3a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/listeners.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ In the module that wants to alter command info, add a class that:
1616

1717
1. The class namespace, relative to base namespace, should be `Drupal\<module-name>\Drush\Listeners` and the class file should be located under the `src/Drush/Listeners` directory.
1818
1. The filename must have a name like FooListener.php. The prefix `Foo` can be whatever string you want. The file must end in `Listener.php`.
19-
1. The class should implement the `#[AsListener]` PHP Attribute.
19+
1. The class should implement the `#[\Symfony\Component\EventDispatcher\Attribute\AsEventListener]` PHP Attribute.
2020
1. Implement your logic via a `__invoke(ConsoleDefinitionsEvent $event)` method. Use a different type hint to listen on a different Event.
2121
1. Inject the logger and any other needed dependencies in the class constructor.
2222

0 commit comments

Comments
 (0)