PHP Class izzum\command\Closure

This allows clients of a Command to inject logic by means of an anonymous function. This provides the flexibility to use custom logic in a command without subclassing a command, while still allowing the use of the command library. eg: $command = new Closure(function() {echo "hello world";}); $command->execute();//echoes 'hello world'
Author: Rolf Vreijdenberger
Inheritance: extends Command
Show file Open project: rolfvreijdenberger/izzum-statemachine Class Usage Examples

Public Methods

Method Description
__construct ( Closure $closure, array $arguments = [] )

Protected Methods

Method Description
_execute ( )

Method Details

__construct() public method

public __construct ( Closure $closure, array $arguments = [] )
$closure Closure
$arguments array an optional array of arguments to pass to the closure

_execute() protected method

protected _execute ( )