File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,14 @@ services:
64
64
- { name: command_handler, handles: Fully\Qualified\Class\Name\Of\RegisterUser }
65
65
` ` `
66
66
67
+ ### Auto-Register command handlers
68
+
69
+ You can omit the ` handles` tag attribute if your handler meets the following conditions:
70
+
71
+ 1. Uses the "class_based" command name resolving strategy
72
+ 2. Handles a single command using the `__invoke` method
73
+ 3. Has a single, non optional class type hinted `__invoke` method parameter
74
+
67
75
> # ### Command handlers are lazy-loaded
68
76
>
69
77
> Since only one of the command handlers is going to handle any particular command, command handlers are lazy-loaded.
Original file line number Diff line number Diff line change @@ -65,6 +65,14 @@ services:
65
65
- { name: event_subscriber, subscribes_to: Fully\Qualified\Class\Name\Of\UserRegistered }
66
66
` ` `
67
67
68
+ ### Auto-Register event subscribers
69
+
70
+ You can omit the ` subscribes_to` tag attribute if your subscriber meets the following conditions:
71
+
72
+ 1. Uses the "class_based" event name resolving strategy
73
+ 2. Subscribers to single event using the `__invoke` method
74
+ 3. Has a single, non optional class type hinted `__invoke` method parameter
75
+
68
76
> # ### Event subscribers are lazy-loaded
69
77
>
70
78
> Since only some of the event subscribers are going to handle any particular event, event subscribers are lazy-loaded.
You can’t perform that action at this time.
0 commit comments