Class SimpleReflection

Description

Version specific reflection API.

Located in /reflection_php5.php (line 14)


	
			
Method Summary
 SimpleReflection __construct (string $interface)
 boolean classExists ()
 boolean classOrInterfaceExistsWithAutoload (string $interface, boolean $autoload)
 string getFullSignature (string $name)
 array getInterfaces ()
 array getMethods ()
 array getParameterSignatures (ReflectionMethod $method)
 string getParent ()
 string getSignature (string $name)
 boolean hasFinal ()
 boolean isAbstract ()
 bool isAbstractMethod (string $name)
 bool isAbstractMethodInParents (string $name)
 bool isConstructor (string $name)
 boolean isInterface ()
 boolean isInterfaceMethod (string $method)
 boolean isOptional (reflectionParameter $parameter)
 bool isStaticMethod (string $name)
 array onlyParents (array $interfaces)
 string suppressSpurious (string $name)
Methods
Constructor __construct (line 22)

Stashes the class/interface.

SimpleReflection __construct (string $interface)
  • string $interface: Class or interface to inspect.
classExists (line 33)

Checks that a class has been declared. Versions before PHP5.0.2 need a check that it's not really an interface.

  • return: True if defined.
  • access: public
boolean classExists ()
classExistsSansAutoload (line 47)

Needed to kill the autoload feature in PHP5 for classes created dynamically.

  • return: True if defined.
  • access: public
boolean classExistsSansAutoload ()
classOrInterfaceExists (line 57)

Checks that a class or interface has been declared.

  • return: True if defined.
  • access: public
boolean classOrInterfaceExists ()
classOrInterfaceExistsSansAutoload (line 67)

Needed to kill the autoload feature in PHP5 for classes created dynamically.

  • return: True if defined.
  • access: public
boolean classOrInterfaceExistsSansAutoload ()
classOrInterfaceExistsWithAutoload (line 79)

Needed to select the autoload feature in PHP5 for classes created dynamically.

  • return: True if interface defined.
  • access: protected
boolean classOrInterfaceExistsWithAutoload (string $interface, boolean $autoload)
  • string $interface: Class or interface name.
  • boolean $autoload: True totriggerautoload.
getFullSignature (line 320)

For a signature specified in an interface, full details must be replicated to be a valid implementation.

  • return: Method signature up to last bracket.
  • access: protected
string getFullSignature (string $name)
  • string $name: Method name.
getInterfaceMethods (line 119)

Gets the list of methods for the implemented interfaces only.

  • return: List of enforced method signatures.
  • access: public
array getInterfaceMethods ()
getInterfaces (line 105)

Gets the list of interfaces from a class. If the class name is actually an interface then just that interface is returned.

  • return: List of interfaces.
  • access: public
array getInterfaces ()
getMethods (line 94)

Gets the list of methods on a class or interface.

  • return: List of method names.
  • access: public
array getMethods ()
getParameterSignatures (line 338)

Gets the source code for each parameter.

  • return: List of strings, each a snippet of code.
  • access: protected
array getParameterSignatures (ReflectionMethod $method)
  • ReflectionMethod $method: Method object from reflection API
getParent (line 143)

Finds the parent class name.

  • return: Parent class name.
  • access: public
string getParent ()
getSignature (line 282)

Writes the source code matching the declaration of a method.

  • return: Method signature up to last bracket.
  • access: public
string getSignature (string $name)
  • string $name: Method name.
hasFinal (line 178)

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

  • return: True if the class has a final method.
  • access: public
boolean hasFinal ()
isAbstract (line 157)

Trivially determines if the class is abstract.

  • return: True if abstract.
  • access: public
boolean isAbstract ()
isAbstractMethod (line 221)

Checks whether a method is abstract or not.

  • return: true if method is abstract, else false
  • access: protected
bool isAbstractMethod (string $name)
  • string $name: Method name.
isAbstractMethodInParents (line 245)

Checks whether a method is abstract in all parents or not.

  • return: true if method is abstract in parent, else false
  • access: protected
bool isAbstractMethodInParents (string $name)
  • string $name: Method name.
isConstructor (line 235)

Checks whether a method is the constructor.

  • return: true if method is the constructor
  • access: protected
bool isConstructor (string $name)
  • string $name: Method name.
isInterface (line 167)

Trivially determines if the class is an interface.

  • return: True if interface.
  • access: public
boolean isInterface ()
isInterfaceMethod (line 134)

Checks to see if the method signature has to be tightly specified.

  • return: True if enforced.
  • access: protected
boolean isInterfaceMethod (string $method)
  • string $method: Method name.
isOptional (line 379)

Test of a reflection parameter being optional that works with early versions of PHP5.

  • return: True if optional.
  • access: protected
boolean isOptional (reflectionParameter $parameter)
  • reflectionParameter $parameter: Is this optional.
isStaticMethod (line 266)

Checks whether a method is static or not.

  • return: true if method is static, else false
  • access: protected
bool isStaticMethod (string $name)
  • string $name: Method name
onlyParents (line 196)

Whittles a list of interfaces down to only the necessary top level parents.

  • return: List of parent interface names.
  • access: protected
array onlyParents (array $interfaces)
  • array $interfaces: Reflection API interfaces to reduce.
suppressSpurious (line 368)

The SPL library has problems with the Reflection library. In particular, you can get extra characters in parameter names :(.

  • return: Cleaner name.
  • access: protected
string suppressSpurious (string $name)
  • string $name: Parameter name.

Documentation generated on Sun, 31 Oct 2010 16:32:10 -0500 by phpDocumentor 1.4.3