PHP Класс Kahlan\Plugin\Double

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

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

Свойство Тип Описание
$_classes array Class dependencies.
$_index integer Stub index counter.
$_pointcut object The pointcut patcher instance.
$_registered array Registered stubbed instance/class methods.

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

Метод Описание
_getMagicMethods ( ) : array Returns Magic Methods definitions.
classname ( array $options = [] ) : string Creates a polyvalent static class.
generate ( array $options = [] ) : string Creates a class definition.
instance ( array $options = [] ) : object Creates a polyvalent instance.

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

Метод Описание
_generateAbstractMethods ( string $class ) : string Creates method definitions from a class name.
_generateClassMethods ( string $class, boolean $layer = null ) : string Creates method definitions from a class name.
_generateExtends ( string $extends ) : string Creates an extends definition.
_generateImplements ( $implements ) : string Creates an implements definition.
_generateInterfaceMethods ( array $interfaces, integer $mask = 255 ) : string Creates method definitions from an interface array.
_generateMethod ( object $method, $callParent = false ) : string Creates a method definition from a ReflectionMethod instance.
_generateMethodStubs ( array $methods, boolean $defaults = true ) : string Creates method stubs.
_generateParameters ( object $method ) : string Creates a parameters list from a ReflectionMethod instance.
_generateReturnType ( objedct $method ) : string Extract the return type of a method.
_generateSignature ( object $method ) : string Creates a parameters signature of a ReflectionMethod instance.
_generateUses ( array $uses ) : string Creates a use definition.

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

_generateAbstractMethods() защищенный статический Метод

Creates method definitions from a class name.
protected static _generateAbstractMethods ( string $class ) : string
$class string A class name.
Результат string The generated methods.

_generateClassMethods() защищенный статический Метод

Creates method definitions from a class name.
protected static _generateClassMethods ( string $class, boolean $layer = null ) : string
$class string A class name.
$layer boolean If `true`, all public methods are "overriden".
Результат string The generated methods.

_generateExtends() защищенный статический Метод

Creates an extends definition.
protected static _generateExtends ( string $extends ) : string
$extends string The parent class name.
Результат string The generated `extends` definition.

_generateImplements() защищенный статический Метод

Creates an implements definition.
protected static _generateImplements ( $implements ) : string
Результат string The generated `implements` definition.

_generateInterfaceMethods() защищенный статический Метод

Creates method definitions from an interface array.
protected static _generateInterfaceMethods ( array $interfaces, integer $mask = 255 ) : string
$interfaces array A array on interfaces.
$mask integer The method mask to filter.
Результат string The generated methods.

_generateMethod() защищенный статический Метод

Creates a method definition from a ReflectionMethod instance.
protected static _generateMethod ( object $method, $callParent = false ) : string
$method object A instance of `ReflectionMethod`.
Результат string The generated method.

_generateMethodStubs() защищенный статический Метод

Creates method stubs.
protected static _generateMethodStubs ( array $methods, boolean $defaults = true ) : string
$methods array An array of method definitions.
$defaults boolean If `true`, Magic Methods will be appended.
Результат string The generated method definitions.

_generateParameters() защищенный статический Метод

Creates a parameters list from a ReflectionMethod instance.
protected static _generateParameters ( object $method ) : string
$method object A instance of `ReflectionMethod`.
Результат string The parameters definition list.

_generateReturnType() защищенный статический Метод

Extract the return type of a method.
protected static _generateReturnType ( objedct $method ) : string
$method objedct A instance of `ReflectionMethod`.
Результат string The return type.

_generateSignature() защищенный статический Метод

Creates a parameters signature of a ReflectionMethod instance.
protected static _generateSignature ( object $method ) : string
$method object A instance of `ReflectionMethod`.
Результат string The parameters definition list.

_generateUses() защищенный статический Метод

Creates a use definition.
protected static _generateUses ( array $uses ) : string
$uses array An array of traits.
Результат string The generated `use` definition.

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

Returns Magic Methods definitions.
public static _getMagicMethods ( ) : array
Результат array

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

Creates a polyvalent static class.
public static classname ( array $options = [] ) : string
$options array Array of options. Options are: - `'class'` : the fully-namespaced class name. - `'extends'` : the fully-namespaced parent class name.
Результат string The created fully-namespaced class name.

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

Creates a class definition.
public static generate ( array $options = [] ) : string
$options array Array of options. Options are: - `'class'` _string_ : the fully-namespaced class name. - `'extends'` _string_ : the fully-namespaced parent class name. - `'implements'` _array_ : the implemented interfaces. - `'uses'` _array_ : the used traits. - `'methods'` _array_ : the methods to stubs. - `'layer'` _boolean_: indicate if public methods should be layered.
Результат string The generated class string content.

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

Creates a polyvalent instance.
public static instance ( array $options = [] ) : object
$options array Array of options. Options are: - `'class'` _string_: the fully-namespaced class name. - `'extends'` _string_: the fully-namespaced parent class name. - `'args'` _array_: arguments to pass to the constructor. - `'methods'` _string_: override the method defined.
Результат object The created instance.

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

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

Class dependencies.
protected static array $_classes
Результат array

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

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

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

The pointcut patcher instance.
protected static object $_pointcut
Результат object

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

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