PHP Class Scientist\Machine

Exibir arquivo 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_oe property

The callback to execute.
protected callable $callback
return callable

$muted protected_oe property

Should exceptions be muted.
protected bool $muted
return boolean

$params protected_oe property

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

$result protected_oe property

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