PHP Класс Kahlan\Plugin\Stub\Method

Наследование: extends Kahlan\Plugin\Call\Message
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_closures Closure Stub implementation.
$_return mixed The method return value.
$_returnIndex integer Index value in the Method::$_returns/Method::$_closures array.
$_returns array Return values.
$_substituteIndex integer Index value in the Method::$_substitutes array.
$_substitutes array Return values.

Открытые методы

Метод Описание
__construct ( array $config = [] ) The Constructor.
__invoke ( array $args = [], string $self = null ) : mixed Runs the stub.
actualReturn ( ) : mixed Get the actual return value.
andReturn ( ) Set return values.
andRun ( ) Set the stub logic.
substitute ( ) : mixed Get the method substitute.
toBe ( ) Set return values.

Описание методов

__construct() публичный Метод

The Constructor.
public __construct ( array $config = [] )
$config array 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).

__invoke() публичный Метод

Runs the stub.
public __invoke ( array $args = [], string $self = null ) : mixed
$args array The call arguments array.
$self string The context from which the stub need to be executed.
Результат mixed The returned stub result.

actualReturn() публичный Метод

Get the actual return value.
public actualReturn ( ) : mixed
Результат mixed

andReturn() публичный Метод

Set return values.
public andReturn ( )

andRun() публичный Метод

Set the stub logic.
public andRun ( )

substitute() публичный Метод

Get the method substitute.
public substitute ( ) : mixed
Результат mixed

toBe() публичный Метод

Set return values.
public toBe ( )

Описание свойств

$_closures защищенное свойство

Stub implementation.
protected Closure $_closures
Результат Closure

$_return защищенное свойство

The method return value.
protected mixed $_return
Результат mixed

$_returnIndex защищенное свойство

Index value in the Method::$_returns/Method::$_closures array.
protected int $_returnIndex
Результат integer

$_returns защищенное свойство

Return values.
protected array $_returns
Результат array

$_substituteIndex защищенное свойство

Index value in the Method::$_substitutes array.
protected int $_substituteIndex
Результат integer

$_substitutes защищенное свойство

Return values.
protected array $_substitutes
Результат array