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'
Show file
Open project: rolfvreijdenberger/izzum-statemachine
Class Usage Examples
Public Methods
Protected Methods
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