PHP 클래스 Kahlan\Plugin\Stub

파일 보기 프로젝트 열기: crysalead/kahlan 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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[]