PHP Class Scientist\Machine

Show file Open project: daylerees/scientist Class Usage Examples

Protected Properties

Property Type Description
$callback callable The callback to execute.
$muted boolean Should exceptions be muted.
$params array Parameters to provide to the callback.
$result Result The result instance.

Public Methods

Method Description
__construct ( callable $callback, array $params = [], boolean $muted = false ) Inject machine dependencies.
execute ( ) : Result Execute the callback and retrieve a result.

Protected Methods

Method Description
executeCallback ( ) : void Execute the callback with parameters.
executeMutedCallback ( ) : void Execute the callback, but swallow exceptions.
setEndValues ( ) : void Set values after the callback has executed.
setStartValues ( ) : void Set values before callback is executed.

Method Details

__construct() public method

Inject machine dependencies.
public __construct ( callable $callback, array $params = [], boolean $muted = false )
$callback callable
$params array
$muted boolean

execute() public method

Execute the callback and retrieve a result.
public execute ( ) : Result
return Result

executeCallback() protected method

Execute the callback with parameters.
protected executeCallback ( ) : void
return void

executeMutedCallback() protected method

Execute the callback, but swallow exceptions.
protected executeMutedCallback ( ) : void
return void

setEndValues() protected method

Set values after the callback has executed.
protected setEndValues ( ) : void
return void

setStartValues() protected method

Set values before callback is executed.
protected setStartValues ( ) : void
return void

Property Details

$callback protected property

The callback to execute.
protected callable $callback
return callable

$muted protected property

Should exceptions be muted.
protected bool $muted
return boolean

$params protected property

Parameters to provide to the callback.
protected array $params
return array

$result protected property

The result instance.
protected Result,Scientist $result
return Result