PHP Class Kraken\Supervision\Supervisor

Inheritance: implements Kraken\Supervision\SupervisorInterface
Show file Open project: kraken-php/framework

Protected Properties

Property Type Description
$factory SolverFactoryInterface
$params mixed[]
$rules Kraken\Supervision\SolverInterface[]

Public Methods

Method Description
__construct ( SolverFactoryInterface $factory, mixed[] $params = [], Kraken\Supervision\SolverInterface[] | string[] $rules = [] )
__destruct ( )
__invoke ( $ex, $params = [] )
existsParam ( $key )
existsSolver ( $exception )
getParam ( $key )
getSolver ( $exception )
removeParam ( $key )
removeSolver ( $exception )
setParam ( $key, $value )
setSolver ( $exception, $handler )
solve ( $ex, $params = [], &$try )

Protected Methods

Method Description
resolveHandler ( Kraken\Supervision\SolverInterface | string $solverOrName ) : Kraken\Supervision\SolverInterface Resolve handler.

Method Details

__construct() public method

public __construct ( SolverFactoryInterface $factory, mixed[] $params = [], Kraken\Supervision\SolverInterface[] | string[] $rules = [] )
$factory SolverFactoryInterface
$params mixed[]
$rules Kraken\Supervision\SolverInterface[] | string[]

__destruct() public method

public __destruct ( )

__invoke() public method

public __invoke ( $ex, $params = [] )

existsParam() public method

public existsParam ( $key )

existsSolver() public method

public existsSolver ( $exception )

getParam() public method

public getParam ( $key )

getSolver() public method

public getSolver ( $exception )

removeParam() public method

public removeParam ( $key )

removeSolver() public method

public removeSolver ( $exception )

resolveHandler() protected method

This method returns passed argument if it is instance of SolverInterface or newly created object of passed class if the $solverOrName argument was string. IllegalCallException is thrown if passed argument is string of invalid class.
protected resolveHandler ( Kraken\Supervision\SolverInterface | string $solverOrName ) : Kraken\Supervision\SolverInterface
$solverOrName Kraken\Supervision\SolverInterface | string
return Kraken\Supervision\SolverInterface

setParam() public method

public setParam ( $key, $value )

setSolver() public method

public setSolver ( $exception, $handler )

solve() public method

public solve ( $ex, $params = [], &$try )

Property Details

$factory protected property

protected SolverFactoryInterface $factory
return SolverFactoryInterface

$params protected property

protected mixed[] $params
return mixed[]

$rules protected property

protected SolverInterface[],Kraken\Supervision $rules
return Kraken\Supervision\SolverInterface[]