Skip to content

Commit

Permalink
Little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
victormln committed Dec 8, 2020
1 parent 934a012 commit c21eec7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Bus.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ public function __construct(
public function dispatch(object $command, array $middleware = [])
{
$fullCommandName = $this->getFullCommandNameOrFail($command);
$fullCommandHandlerName = $this->getCommandHandlerName($fullCommandName);
if(!$this->handlerLocator->handlers() || !$this->commandHasABoundedCommandHandler($command)) {
$this->bindCommandWitHisCommandHandler($fullCommandName, $fullCommandHandlerName);
$this->bindCommandWitHisCommandHandler($fullCommandName, $this->getCommandHandlerName($fullCommandName));
}

return $this->handleTheCommand($command, $middleware);
Expand Down

0 comments on commit c21eec7

Please sign in to comment.