The Constructor.
public __construct ( array $config = [] ) | ||
$config | array | Possible options are: - `'reference'` _mixed_ : The message reference. - `'name'` _string_ : The message name. - `'args'` _array_ : The message arguments. - `'static'` _boolean_: `true` if the method is static, `false` otherwise. |
/** * The Constructor. * * @param array $config The options array, possible options are: * - `'closure'`: the closure to execute for this stub. * - `'params'`: the params required for exectuting this stub. * - `'static'`: the type of call required for exectuting this stub. * - `'returns'`: the returns values for this stub (used only if * the `'closure'` option is missing). */ public function __construct($config = []) { $defaults = ['closure' => null, 'params' => [], 'returns' => [], 'static' => false]; $config += $defaults; parent::__construct($config); $this->_closure = $config['closure']; $this->_returns = $config['returns']; }
/** * The Constructor. * * @param array $config The options array, possible options are: * - `'closure'`: the closure to execute for this stub. * - `'args'`: the arguments required for exectuting this stub. * - `'static'`: the type of call required for exectuting this stub. * - `'returns'`: the returns values for this stub (used only if * the `'closure'` option is missing). */ public function __construct($config = []) { $defaults = ['closures' => null, 'args' => [], 'returns' => null, 'static' => false]; $config += $defaults; parent::__construct($config); $this->_name = ltrim($this->_name, '\\'); $this->_closures = $config['closures']; $this->_returns = $config['returns']; }