프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_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. |
protected static _generateAbstractMethods ( string $class ) : string | ||
$class | string | A class name. |
리턴 | string | The generated methods. |
protected static _generateExtends ( string $extends ) : string | ||
$extends | string | The parent class name. |
리턴 | string | The generated `extends` definition. |
protected static _generateImplements ( $implements ) : string | ||
리턴 | string | The generated `implements` definition. |
protected static _generateMethod ( object $method, $callParent = false ) : string | ||
$method | object | A instance of `ReflectionMethod`. |
리턴 | string | The generated method. |
protected static _generateParameters ( object $method ) : string | ||
$method | object | A instance of `ReflectionMethod`. |
리턴 | string | The parameters definition list. |
protected static _generateReturnType ( objedct $method ) : string | ||
$method | objedct | A instance of `ReflectionMethod`. |
리턴 | string | The return type. |
protected static _generateSignature ( object $method ) : string | ||
$method | object | A instance of `ReflectionMethod`. |
리턴 | string | The parameters definition list. |
protected static _generateUses ( array $uses ) : string | ||
$uses | array | An array of traits. |
리턴 | string | The generated `use` definition. |
public static _getMagicMethods ( ) : array | ||
리턴 | array |
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. |
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. |
protected static object $_pointcut | ||
리턴 | object |
protected static array $_registered | ||
리턴 | array |