public function toHandler($command)
    {
        $class = get_class($command);
        $offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
        $handlerClass = substr_replace($class, 'Handler', $offset);

        if (!class_exists($handlerClass)) {
            $message = "Command handler [$handlerClass] does not exist.";
            throw new HandlerNotRegisteredException($message);
        }

        return $handlerClass;
    }
public function toHandler($command)
    {
        $class = get_class($command);
        $offset = ($this->positionAt('Command', $class)) ?: $this->positionAt('Request', $class);
        $handlerClass = substr_replace($class, 'Handler', $offset);

        if (!class_exists($handlerClass)) {
            $message = "Command handler [$handlerClass] does not exist.";
            throw new HandlerNotRegisteredException($message);
        }

        return $handlerClass;
    }
public function toHandler ( $ command ) { $ class = get_class ( $ command ) ; $ offset = ( $ this -> positionAt ( 'Command' , $ class ) ) ? : $ this -> positionAt ( 'Request' , $ class ) ; $ handlerClass = substr_replace ( $ class , 'Handler' , $ offset ) ; if ( ! class_exists ( $ handlerClass ) ) { $ message = "Command handler [$handlerClass] does not exist." ; throw new HandlerNotRegisteredException ( $ message ) ; } return $ handlerClass ; }
Translate a command to its respective handler.

@param $command
@return mixed
@throws HandlerNotRegisteredException
Translate a command to its respective handler .