public function toCommandHandler($command)
    {
        $commandClass = get_class($command);
        $handler = substr_replace($commandClass, 'CommandHandler', strrpos($commandClass, 'Command'));

        if ( ! class_exists($handler))
        {
            $message = "Command handler [$handler] does not exist.";

            throw new HandlerNotRegisteredException($message);
        }

        return $handler;
    }
public function toCommandHandler($command)
    {
        $commandClass = get_class($command);
        $handler = substr_replace($commandClass, 'CommandHandler', strrpos($commandClass, 'Command'));

        if ( ! class_exists($handler))
        {
            $message = "Command handler [$handler] does not exist.";

            throw new HandlerNotRegisteredException($message);
        }

        return $handler;
    }
public function toCommandHandler ( $ command ) { $ commandClass = get_class ( $ command ) ; $ handler = substr_replace ( $ commandClass , 'CommandHandler' , strrpos ( $ commandClass , 'Command' ) ) ; if ( ! class_exists ( $ handler ) ) { $ message = "Command handler [$handler] does not exist." ; throw new HandlerNotRegisteredException ( $ message ) ; } return $ handler ; }
Translate a command to its handler counterpart

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