PHP Класс Kahlan\Plugin\Stub

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_chain Kahlan\Plugin\Stub\Method[] Method chain.
$_methods Kahlan\Plugin\Stub\Method[] Stubbed methods.
$_needToBePatched integer Stub index counter.
$_registered array Registered stubbed instance/class methods.
$_stubs Kahlan\Plugin\Stub\Method[] Generic stubs.

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

Метод Описание
__construct ( mixed $reference ) The Constructor.
find ( mixed $references, string $method = null, array $args = null ) : object | null Finds a stub.
method ( string $path, string $closure = null ) : Method Stubs a method.
methods ( array $name = [] ) : Method[] Getd/Setd stubs for methods or get stubbed methods array.
on ( object | string $reference ) : self Stubs class methods.
registered ( mixed $hash = null ) : boolean | array Checks if a stub has been registered for a hash
reset ( string $reference = null ) Clears the registered references.
where ( $requirements = [] ) : self Set arguments requirement indexed by method name.

Защищенные методы

Метод Описание
_reference ( mixed $reference ) Return the actual reference which must be used.

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

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

The Constructor.
public __construct ( mixed $reference )
$reference mixed An instance or a fully-namespaced class name.

_reference() защищенный Метод

Return the actual reference which must be used.
protected _reference ( mixed $reference )
$reference mixed An instance or a fully-namespaced class name.

find() публичный статический Метод

Finds a stub.
public static find ( mixed $references, string $method = null, array $args = null ) : object | null
$references mixed An instance or a fully namespaced class name. or an array of that.
$method string The method name.
$args array The required arguments.
Результат object | null Return the subbed method or `null` if not founded.

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

Stubs a method.
public method ( string $path, string $closure = null ) : Method
$path string Method name or array of stubs where key are method names and values the stubs.
$closure string The stub implementation.
Результат Kahlan\Plugin\Stub\Method The created array of method instances.

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

Getd/Setd stubs for methods or get stubbed methods array.
public methods ( array $name = [] ) : Method[]
$name array An array of method names.
Результат Kahlan\Plugin\Stub\Method[] Return the array of stubbed methods.

on() публичный статический Метод

Stubs class methods.
public static on ( object | string $reference ) : self
$reference object | string An instance or a fully-namespaced class name.
Результат self The Stub instance.

registered() публичный статический Метод

Checks if a stub has been registered for a hash
public static registered ( mixed $hash = null ) : boolean | array
$hash mixed An instance hash or a fully namespaced class name.
Результат boolean | array

reset() публичный статический Метод

Clears the registered references.
public static reset ( string $reference = null )
$reference string An instance or a fully namespaced class name or `null` to clear all.

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

Set arguments requirement indexed by method name.
public where ( $requirements = [] ) : self
Результат self

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

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

Method chain.
protected Method[],Kahlan\Plugin\Stub $_chain
Результат Kahlan\Plugin\Stub\Method[]

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

Stubbed methods.
protected Method[],Kahlan\Plugin\Stub $_methods
Результат Kahlan\Plugin\Stub\Method[]

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

Stub index counter.
protected int $_needToBePatched
Результат integer

$_registered защищенное статическое свойство

Registered stubbed instance/class methods.
protected static array $_registered
Результат array

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

Generic stubs.
protected Method[],Kahlan\Plugin\Stub $_stubs
Результат Kahlan\Plugin\Stub\Method[]