PHP Class SM\Callback\Callback

Inheritance: implements SM\Callback\CallbackInterface
Show file Open project: winzou/state-machine Class Usage Examples

Protected Properties

Property Type Description
$callable mixed
$specs array

Public Methods

Method Description
__construct ( array $specs, mixed $callable )
__invoke ( SM\Event\TransitionEvent $event ) {@inheritDoc}
call ( SM\Event\TransitionEvent $event ) : mixed
isSatisfiedBy ( SM\Event\TransitionEvent $event ) {@inheritDoc}

Protected Methods

Method Description
filterCallable ( callable | array $callable, SM\Event\TransitionEvent $event ) : callable
isSatisfiedByClause ( string $clause, string $value ) : boolean

Method Details

__construct() public method

public __construct ( array $specs, mixed $callable )
$specs array Specification for the Callback to be called
$callable mixed Closure or Callable that will be called if specifications pass

__invoke() public method

{@inheritDoc}
public __invoke ( SM\Event\TransitionEvent $event )
$event SM\Event\TransitionEvent

call() public method

public call ( SM\Event\TransitionEvent $event ) : mixed
$event SM\Event\TransitionEvent
return mixed The returned value from the callback

filterCallable() protected method

protected filterCallable ( callable | array $callable, SM\Event\TransitionEvent $event ) : callable
$callable callable | array A callable or array with index 0 starting with "object" that will evaluated as a property path with "object" being the object undergoing the transition
$event SM\Event\TransitionEvent
return callable

isSatisfiedBy() public method

{@inheritDoc}
public isSatisfiedBy ( SM\Event\TransitionEvent $event )
$event SM\Event\TransitionEvent

isSatisfiedByClause() protected method

protected isSatisfiedByClause ( string $clause, string $value ) : boolean
$clause string The clause to check (on, from or to)
$value string The value to check the clause against
return boolean

Property Details

$callable protected property

protected mixed $callable
return mixed

$specs protected property

protected array $specs
return array