/** * Get the handler class using the mapping. * * @param Command $command The command to get the handler class from. * * @throws Exception Could not find handler from mapping. * * @return string */ protected function resolveClass(Command $command) { $handlers = array_flip($this->mapping); if (!isset($handlers[$command->getIdentifier()])) { throw new HandlerNotFoundException($command); } return $handlers[$command->getIdentifier()]; }
/** * {@inheritdoc} */ public function __construct(Command $command, $code = 0, $clause = null) { parent::__construct("Could not find a handler for command with identifier {$command->getIdentifier()}", $code, $clause); }