You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/listeners.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ In the module that wants to alter command info, add a class that:
16
16
17
17
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.
18
18
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.
20
20
1. Implement your logic via a `__invoke(ConsoleDefinitionsEvent $event)` method. Use a different type hint to listen on a different Event.
21
21
1. Inject the logger and any other needed dependencies in the class constructor.
0 commit comments