Skip to content

Commit

Permalink
Fix ternary bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Feb 3, 2015
1 parent bf2ad5c commit 7f8a6d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Registries/CommandRegistry.php
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Registries/EventRegistry.php
Expand Up @@ -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);
Expand Down

0 comments on commit 7f8a6d3

Please sign in to comment.