/** * @param Command $command * @return void */ public function execute(Command $command) { $handler = $this->commandTranslator->toCommandHandler($command); $this->handlerResolver->make($handler)->handle($command); }
/** * @param Command $command * @param callable $next * @return mixed|void */ public function execute(Command $command, callable $next) { $handler = $this->commandTranslator->toCommandHandler($command); return $this->handlerResolver->make($handler)->handle($command); }