src/mako/commander/CommandBus.php
protected function resolveCommandHandler(CommandInterface $command): CommandHandlerInterface
	{
		$class = get_class($command);

		// Build handler class name

		$commandSuffixLength = strlen(static::COMMAND_SUFFIX);

		if(static::COMMAND_SUFFIX === substr($class, -$commandSuffixLength))
		{
			$handler = substr_replace($class, static::HANDLER_SUFFIX, strrpos($class, static::COMMAND_SUFFIX), $commandSuffixLength);
		}
		else
		{
			$handler = $class . static::HANDLER_SUFFIX;
		}

		// Return handler instance

		return $this->container->get($handler);
	}
protected function resolveCommandHandler(CommandInterface $command): CommandHandlerInterface
	{
		$class = get_class($command);

		// Build handler class name

		$commandSuffixLength = strlen(static::COMMAND_SUFFIX);

		if(static::COMMAND_SUFFIX === substr($class, -$commandSuffixLength))
		{
			$handler = substr_replace($class, static::HANDLER_SUFFIX, strrpos($class, static::COMMAND_SUFFIX), $commandSuffixLength);
		}
		else
		{
			$handler = $class . static::HANDLER_SUFFIX;
		}

		// Return handler instance

		return $this->container->get($handler);
	}
protected function resolveCommandHandler ( CommandInterface $ command ) : CommandHandlerInterface { $ class = get_class ( $ command ) ; // Build handler class name $ commandSuffixLength = strlen ( static :: COMMAND_SUFFIX ) ; if ( static :: COMMAND_SUFFIX === substr ( $ class , - $ commandSuffixLength ) ) { $ handler = substr_replace ( $ class , static :: HANDLER_SUFFIX , strrpos ( $ class , static :: COMMAND_SUFFIX ) , $ commandSuffixLength ) ; } else { $ handler = $ class . static :: HANDLER_SUFFIX ; } // Return handler instance return $ this -> container -> get ( $ handler ) ; }
Resolves the command handler.

@param  \mako\commander\CommandInterface        $command Command
@return \mako\commander\CommandHandlerInterface
Resolves the command handler .