File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -2271,9 +2271,11 @@ handler is registered. The ``HandleTrait`` can be used in any class that has a
22712271 {
22722272 use HandleTrait;
22732273
2274- public function __construct(
2275- private MessageBusInterface $messageBus,
2276- ) {
2274+ // the parameter must be named $queryBus to trigger autowiring of the 'query.bus' service
2275+ public function __construct(MessageBusInterface $queryBus)
2276+ {
2277+ // HandleTrait requires a property named $messageBus
2278+ $this->messageBus = $queryBus;
22772279 }
22782280
22792281 public function __invoke(): void
@@ -2306,9 +2308,11 @@ wherever you need a query bus behavior instead of the ``MessageBusInterface``::
23062308 {
23072309 use HandleTrait;
23082310
2309- public function __construct(
2310- private MessageBusInterface $messageBus,
2311- ) {
2311+ // the parameter must be named $queryBus to trigger autowiring of the 'query.bus' service
2312+ public function __construct(MessageBusInterface $queryBus)
2313+ {
2314+ // HandleTrait requires a property named $messageBus
2315+ $this->messageBus = $queryBus;
23122316 }
23132317
23142318 /**
You can’t perform that action at this time.
0 commit comments