diff --git a/src/Registries/CommandRegistry.php b/src/Registries/CommandRegistry.php index 7da1a8b..f085473 100644 --- a/src/Registries/CommandRegistry.php +++ b/src/Registries/CommandRegistry.php @@ -23,7 +23,7 @@ public function __construct(CommandBusInterface $commandBus) */ public function subscribe($handlers) { - $this->isTraversable($handlers) ?: [$handlers]; + $handlers = $this->isTraversable($handlers) ? $handlers : [$handlers]; foreach ($handlers as $commandHandler) { $this->commandBus->subscribe($commandHandler); diff --git a/src/Registries/EventRegistry.php b/src/Registries/EventRegistry.php index 9bd96a1..c8e5336 100644 --- a/src/Registries/EventRegistry.php +++ b/src/Registries/EventRegistry.php @@ -20,7 +20,7 @@ public function __construct(EventBusInterface $eventBus) */ public function subscribe($projectors) { - $projectors = $this->isTraversable($projectors) ?: [$projectors]; + $projectors = $this->isTraversable($projectors) ? $projectors : [$projectors]; foreach ($projectors as $projector) { $this->eventBus->subscribe($projector);