/**
  * Try to handle the command given in argument.
  * It will look over every handlers registered and find the one that knows how handle it.
  *
  * @param AbstractCommand $command
  *
  * @return AbstractCommand
  */
 public function handle(AbstractCommand $command)
 {
     $this->commandDispatcher->handle($command);
     // Now that the command is handled, let's found if there is some events to publish
     $events = $this->extractEventsFromCommand($command);
     foreach ($events as $event) {
         // we will only publish event to synchronous listeners
         $this->publish($event);
     }
     return $command;
 }