class Dispatcher

Command dispatcher.

Properties

protected Container $container Container.

Methods

__construct(Container $container)

Constructor.

resolve(string $command)

Resolves the command.

array
filterArguments(array $arguments)

Returns arguments where null values have been removed.

mixed
execute(CommandInterface $command, array $arguments)

Executes the command.

int
dispatch(string $command, array $arguments)

Dispatches the command.

Details

at line 32
__construct(Container $container)

Constructor.

Parameters

Container $container Container

at line 43
protected CommandInterface resolve(string $command)

Resolves the command.

Parameters

string $command Command class

Return Value

CommandInterface

at line 54
protected array filterArguments(array $arguments)

Returns arguments where null values have been removed.

Parameters

array $arguments

Return Value

array

at line 69
protected mixed execute(CommandInterface $command, array $arguments)

Executes the command.

Parameters

CommandInterface $command Command instance
array $arguments Command arguments

Return Value

mixed

at line 81
int dispatch(string $command, array $arguments)

Dispatches the command.

Parameters

string $command Command class
array $arguments Command arguments

Return Value

int