From 7f8a6d37b0ee0a349ff936f4dc299e0105e55779 Mon Sep 17 00:00:00 2001 From: Nicolas Widart Date: Tue, 3 Feb 2015 13:46:16 +0100 Subject: [PATCH] Fix ternary bug --- src/Registries/CommandRegistry.php | 2 +- src/Registries/EventRegistry.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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);