PHP 클래스 SimpleReflection, simpletest

@package SimpleTest
파일 보기 프로젝트 열기: simpletest/simpletest 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $interface ) Stashes the class/interface.
classExists ( ) : boolean Checks that a class has been declared.
classExistsSansAutoload ( ) : boolean Needed to kill the autoload feature in PHP5 for classes created dynamically.
classOrInterfaceExists ( ) : boolean Checks that a class or interface has been declared.
classOrInterfaceExistsSansAutoload ( ) : boolean Needed to kill the autoload feature in PHP5 for classes created dynamically.
getInterfaceMethods ( ) Gets the list of methods for the implemented interfaces only.
getInterfaces ( ) Gets the list of interfaces from a class.
getMethods ( ) Gets the list of methods on a class or interface.
getParent ( ) Finds the parent class name.
getSignature ( string $name ) : string Writes the source code matching the declaration of a method.
hasFinal ( ) Scans for final methods, as they screw up inherited mocks by not allowing you to override them.
isAbstract ( ) Trivially determines if the class is abstract.
isInterface ( ) Trivially determines if the class is an interface.

보호된 메소드들

메소드 설명
classOrInterfaceExistsWithAutoload ( string $interface, boolean $autoload ) : boolean Needed to select the autoload feature in PHP5 for classes created dynamically.
getFullSignature ( string $name ) : string For a signature specified in an interface, full details must be replicated to be a valid implementation.
getParameterSignatures ( ReflectionMethod $method ) : array Gets the source code for each parameter.
isAbstractMethod ( string $name ) : boolean Checks whether a method is abstract or not.
isAbstractMethodInParents ( string $name ) : boolean Checks whether a method is abstract in all parents or not.
isConstructor ( string $name ) : boolean Checks whether a method is the constructor.
isInterfaceMethod ( string $method ) Checks to see if the method signature has to be tightly specified.
isStaticMethod ( string $name ) : boolean Checks whether a method is static or not.
onlyParents ( array $interfaces ) : array Whittles a list of interfaces down to only the necessary top level parents.
suppressSpurious ( string $name ) : string The SPL library has problems with the Reflection library.

메소드 상세

__construct() 공개 메소드

Stashes the class/interface.
public __construct ( string $interface )
$interface string Class or interface to inspect.

classExists() 공개 메소드

Checks that a class has been declared.
public classExists ( ) : boolean
리턴 boolean True if defined.

classExistsSansAutoload() 공개 메소드

Needed to kill the autoload feature in PHP5 for classes created dynamically.
public classExistsSansAutoload ( ) : boolean
리턴 boolean True if defined.

classOrInterfaceExists() 공개 메소드

Checks that a class or interface has been declared.
public classOrInterfaceExists ( ) : boolean
리턴 boolean True if defined.

classOrInterfaceExistsSansAutoload() 공개 메소드

Needed to kill the autoload feature in PHP5 for classes created dynamically.
public classOrInterfaceExistsSansAutoload ( ) : boolean
리턴 boolean True if defined.

classOrInterfaceExistsWithAutoload() 보호된 메소드

Needed to select the autoload feature in PHP5 for classes created dynamically.
protected classOrInterfaceExistsWithAutoload ( string $interface, boolean $autoload ) : boolean
$interface string Class or interface name.
$autoload boolean True totriggerautoload.
리턴 boolean True if interface defined.

getFullSignature() 보호된 메소드

For a signature specified in an interface, full details must be replicated to be a valid implementation.
protected getFullSignature ( string $name ) : string
$name string Method name.
리턴 string Method signature up to last bracket.

getInterfaceMethods() 공개 메소드

Gets the list of methods for the implemented interfaces only.
public getInterfaceMethods ( )

getInterfaces() 공개 메소드

If the class name is actually an interface then just that interface is returned.
public getInterfaces ( )

getMethods() 공개 메소드

Gets the list of methods on a class or interface.
public getMethods ( )

getParameterSignatures() 보호된 메소드

Gets the source code for each parameter.
protected getParameterSignatures ( ReflectionMethod $method ) : array
$method ReflectionMethod Method object from reflection API
리턴 array List of strings, each a snippet of code.

getParent() 공개 메소드

Finds the parent class name.
public getParent ( )

getSignature() 공개 메소드

Writes the source code matching the declaration of a method.
public getSignature ( string $name ) : string
$name string Method name.
리턴 string Method signature up to last bracket.

hasFinal() 공개 메소드

Scans for final methods, as they screw up inherited mocks by not allowing you to override them.
public hasFinal ( )

isAbstract() 공개 메소드

Trivially determines if the class is abstract.
public isAbstract ( )

isAbstractMethod() 보호된 메소드

Checks whether a method is abstract or not.
protected isAbstractMethod ( string $name ) : boolean
$name string Method name.
리턴 boolean true if method is abstract, else false

isAbstractMethodInParents() 보호된 메소드

Checks whether a method is abstract in all parents or not.
protected isAbstractMethodInParents ( string $name ) : boolean
$name string Method name.
리턴 boolean true if method is abstract in parent, else false

isConstructor() 보호된 메소드

Checks whether a method is the constructor.
protected isConstructor ( string $name ) : boolean
$name string Method name.
리턴 boolean true if method is the constructor

isInterface() 공개 메소드

Trivially determines if the class is an interface.
public isInterface ( )

isInterfaceMethod() 보호된 메소드

Checks to see if the method signature has to be tightly specified.
protected isInterfaceMethod ( string $method )
$method string Method name.

isStaticMethod() 보호된 메소드

Checks whether a method is static or not.
protected isStaticMethod ( string $name ) : boolean
$name string Method name
리턴 boolean true if method is static, else false

onlyParents() 보호된 메소드

Whittles a list of interfaces down to only the necessary top level parents.
protected onlyParents ( array $interfaces ) : array
$interfaces array Reflection API interfaces to reduce.
리턴 array List of parent interface names.

suppressSpurious() 보호된 메소드

In particular, you can get extra characters in parameter names :(.
protected suppressSpurious ( string $name ) : string
$name string Parameter name.
리턴 string Cleaner name.