Apache Zeta Components Manual :: Docs For Class ezcReflectionClass
Reflection::ezcReflectionClass
Class ezcReflectionClass
Extends the ReflectionClass class to provide type information using PHPDoc annotations.
Source for this file: /Reflection/src/class.php
ReflectionClass | --ezcReflectionClass
Version: | //autogen// |
Inherited Constants
From ReflectionClass (Internal Class): | |
---|---|
IS_EXPLICIT_ABSTRACT = 32
|
|
IS_FINAL = 64
|
|
IS_IMPLICIT_ABSTRACT = 16
|
Member Variables
protected ezcReflectionDocCommentParser |
$docParser
|
protected string|object|ReflectionClass |
$reflectionSource
|
Inherited Member Variables
From ReflectionClass (Internal Class) | |
---|---|
public |
$name
|
Method Summary
public static mixed |
export(
$class
, [ $return
= false] )
Exports a ReflectionClass instance. |
public ezcReflectionClass |
__construct(
$argument
)
Constructs a new ezcReflectionClass object. |
protected mixed |
forwardCallToReflectionSource(
$method
, [ $arguments
= array()] )
Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class. |
public ezcReflectionAnnotation[] |
getAnnotations(
[ $name
= ''] )
Returns an array of annotations (optinally only annotations of a given name) |
public mixed |
getConstant(
$name
)
Returns the class' constant specified by its name |
public array |
getConstants(
)
Returns an associative array containing this class' constants and their values. |
public ezcReflectionMethod |
getConstructor(
)
Returns an ezcReflectionMethod object of the constructor method. |
public array |
getDefaultProperties(
)
Returns an associative array containing copies of all default property values of the class. |
public string |
getDocComment(
)
Returns the doc comment for the class. |
public integer |
getEndLine(
)
Returns the line this class' declaration ends at |
public ezcReflectionExtension |
getExtension(
)
Returns NULL or the extension the class belongs to |
public string|boolean |
getExtensionName(
)
Returns FALSE or the name of the extension the class belongs to |
public string |
getFileName(
)
Returns the filename of the file this class was declared in |
public string[] |
getInterfaceNames(
)
Returns an array of names of interfaces this class implements |
public ezcReflectionClass[] |
getInterfaces(
)
Returns an array of all interfaces implemented by the class. |
public string |
getLongDescription(
)
Returns the long description of the class from the source code documentation |
public ezcReflectionMethod |
getMethod(
$name
)
Returns an ezcReflectionMethod object of the method specified by $name. |
public ezcReflectionMethod[] |
getMethods(
[ $filter
= -1] )
Returns the methods as an array of ezcReflectionMethod objects. |
public integer |
getModifiers(
)
Returns a bitfield of the access modifiers for this class |
public string |
getName(
)
Returns the name of the class. |
public string |
getNamespaceName(
)
Returns the name of namespace where this class is defined |
public ezcReflectionClass|boolean |
getParentClass(
)
Returns the class' parent class, or, if none exists, FALSE |
public ezcReflectionProperty[] |
getProperties(
[ $filter
= -1] )
Returns an array of this class' properties |
public ezcReflectionProperty |
getProperty(
$name
)
Returns the class' property specified by its name |
public string |
getShortDescription(
)
Returns the short description of the class from the source code documentation |
public string |
getShortName(
)
Returns the short name of the class (without namespace part) |
public integer |
getStartLine(
)
Returns the line this class' declaration starts at |
public array |
getStaticProperties(
)
Returns an associative array containing all static property values of the class |
public mixed |
getStaticPropertyValue(
$name
, [ $default
= null] )
Returns the value of a static property |
public boolean |
hasAnnotation(
$annotation
)
Checks whether the class is annotated with the annotation $annotation |
public boolean |
hasConstant(
$name
)
Returns whether a constant exists or not |
public boolean |
hasMethod(
$name
)
Returns whether a method exists or not |
public boolean |
hasProperty(
$name
)
Returns whether a property exists or not |
public boolean |
implementsInterface(
$interface
)
Returns whether this class implements a given interface |
public boolean |
inNamespace(
)
Returns whether this class is defined in a namespace |
public boolean |
isAbstract(
)
Returns whether this class is abstract |
public boolean |
isFinal(
)
Returns whether this class is final |
public boolean |
isInstance(
$object
)
Returns whether the given object is an instance of this class |
public boolean |
isInstantiable(
)
Returns whether this class is instantiable |
public boolean |
isInterface(
)
Returns whether this class is an interface |
public boolean |
isInternal(
)
Returns whether this class is an internal class |
public boolean |
isIterateable(
)
Returns whether this class is iterateable (can be used inside foreach) |
public boolean |
isSubclassOf(
$class
)
Returns whether this class is a subclass of another class |
public boolean |
isUserDefined(
)
Returns whether this class is user-defined |
public object An |
newInstance(
$arguments
, $argument,...
)
Returns an instance of this class |
public object An |
newInstanceArgs(
[ $arguments
= null] )
Returns an instance of this class |
public void |
setStaticPropertyValue(
$name
, $value
, $default
)
Sets the value of a static property |
public mixed |
__call(
$method
, $arguments
)
Use overloading to call additional methods of the ReflectionClass instance given to the constructor. |
public string |
__toString(
)
Returns a string representation |
Inherited Methods
From ReflectionClass (Internal Class) | |
---|---|
public ReflectionClass |
constructor __construct ( $argument )
|
public void |
export ( $argument, [$return = ] )
|
public void |
getConstant ( $name )
|
public void |
getConstants ( )
|
public void |
getConstructor ( )
|
public void |
getDefaultProperties ( )
|
public void |
getDocComment ( )
|
public void |
getEndLine ( )
|
public void |
getExtension ( )
|
public void |
getExtensionName ( )
|
public void |
getFileName ( )
|
public void |
getInterfaceNames ( )
|
public void |
getInterfaces ( )
|
public void |
getMethod ( $name )
|
public void |
getMethods ( [$filter = ] )
|
public void |
getModifiers ( )
|
public void |
getName ( )
|
public void |
getNamespaceName ( )
|
public void |
getParentClass ( )
|
public void |
getProperties ( [$filter = ] )
|
public void |
getProperty ( $name )
|
public void |
getShortName ( )
|
public void |
getStartLine ( )
|
public void |
getStaticProperties ( )
|
public void |
getStaticPropertyValue ( $name, [$default = ] )
|
public void |
hasConstant ( $name )
|
public void |
hasMethod ( $name )
|
public void |
hasProperty ( $name )
|
public void |
implementsInterface ( $interface )
|
public void |
inNamespace ( )
|
public void |
isAbstract ( )
|
public void |
isFinal ( )
|
public void |
isInstance ( $object )
|
public void |
isInstantiable ( )
|
public void |
isInterface ( )
|
public void |
isInternal ( )
|
public void |
isIterateable ( )
|
public void |
isSubclassOf ( $class )
|
public void |
isUserDefined ( )
|
public void |
newInstance ( $args )
|
public void |
newInstanceArgs ( [$args = ] )
|
public void |
setStaticPropertyValue ( $name, $value )
|
public void |
__clone ( )
|
public void |
__toString ( )
|
Methods
export
Exports a ReflectionClass instance.
Returns the output if TRUE is specified for $return, printing it otherwise. This is purely a wrapper method, which calls the corresponding method of the parent class (ReflectionClass::export()).
Parameters:
Name | Type | Description |
---|---|---|
$class |
ReflectionClass|string | ReflectionClass object or name of the class |
$return |
boolean | Whether to return (TRUE) or print (FALSE) the output |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::export ( $argument, [$return = ] ) |
__construct
Constructs a new ezcReflectionClass object.
Parameters:
Name | Type | Description |
---|---|---|
$argument |
string|object|ReflectionClass | Name, instance or ReflectionClass object of the class to be reflected |
Exceptions:
Type | Description |
---|---|
ReflectionException |
if the specified class doesn't exist |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::constructor __construct ( $argument ) |
forwardCallToReflectionSource
Forwards a method invocation to either the reflection source passed to the constructor of this class when creating an instance or to the parent class.
This method is part of the dependency injection mechanism and serves as a helper for implementing wrapper methods without code duplication.
Parameters:
Name | Type | Description |
---|---|---|
$method |
string | Name of the method to be invoked |
$arguments |
mixed[] | Arguments to be passed to the method |
getAnnotations
Returns an array of annotations (optinally only annotations of a given name)
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the annotations |
getConstant
Returns the class' constant specified by its name
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the constant |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getConstant ( $name ) |
getConstants
Returns an associative array containing this class' constants and their values.
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getConstants ( ) |
getConstructor
Returns an ezcReflectionMethod object of the constructor method.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getConstructor ( ) |
getDefaultProperties
Returns an associative array containing copies of all default property values of the class.
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getDefaultProperties ( ) |
getDocComment
Returns the doc comment for the class.
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getDocComment ( ) |
getEndLine
Returns the line this class' declaration ends at
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getEndLine ( ) |
getExtension
Returns NULL or the extension the class belongs to
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getExtension ( ) |
getExtensionName
Returns FALSE or the name of the extension the class belongs to
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getExtensionName ( ) |
getFileName
Returns the filename of the file this class was declared in
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getFileName ( ) |
getInterfaceNames
Returns an array of names of interfaces this class implements
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getInterfaceNames ( ) |
getInterfaces
Returns an array of all interfaces implemented by the class.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getInterfaces ( ) |
getLongDescription
Returns the long description of the class from the source code documentation
getMethod
Returns an ezcReflectionMethod object of the method specified by $name.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the method |
Exceptions:
Type | Description |
---|---|
ReflectionException |
if method doesn't exist |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getMethod ( $name ) |
getMethods
Returns the methods as an array of ezcReflectionMethod objects.
Parameters:
Name | Type | Description |
---|---|---|
$filter |
integer | A combination of ReflectionMethod::IS_STATIC, ReflectionMethod::IS_PUBLIC, ReflectionMethod::IS_PROTECTED, ReflectionMethod::IS_PRIVATE, ReflectionMethod::IS_ABSTRACT and ReflectionMethod::IS_FINAL |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getMethods ( [$filter = ] ) |
getModifiers
Returns a bitfield of the access modifiers for this class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getModifiers ( ) |
getName
Returns the name of the class.
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getName ( ) |
getNamespaceName
Returns the name of namespace where this class is defined
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getNamespaceName ( ) |
getParentClass
Returns the class' parent class, or, if none exists, FALSE
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getParentClass ( ) |
getProperties
Returns an array of this class' properties
Parameters:
Name | Type | Description |
---|---|---|
$filter |
integer | A combination of ReflectionProperty::IS_STATIC, ReflectionProperty::IS_PUBLIC, ReflectionProperty::IS_PROTECTED and ReflectionProperty::IS_PRIVATE |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getProperties ( [$filter = ] ) |
getProperty
Returns the class' property specified by its name
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the property |
Exceptions:
Type | Description |
---|---|
RelectionException |
if property doesn't exist |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getProperty ( $name ) |
getShortDescription
Returns the short description of the class from the source code documentation
getShortName
Returns the short name of the class (without namespace part)
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getShortName ( ) |
getStartLine
Returns the line this class' declaration starts at
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getStartLine ( ) |
getStaticProperties
Returns an associative array containing all static property values of the class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getStaticProperties ( ) |
getStaticPropertyValue
Returns the value of a static property
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the static property |
$default |
mixed | Default value |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::getStaticPropertyValue ( $name, [$default = ] ) |
hasAnnotation
Checks whether the class is annotated with the annotation $annotation
Parameters:
Name | Type | Description |
---|---|---|
$annotation |
string | Name of the annotation |
hasConstant
Returns whether a constant exists or not
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the constant |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::hasConstant ( $name ) |
hasMethod
Returns whether a method exists or not
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the method |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::hasMethod ( $name ) |
hasProperty
Returns whether a property exists or not
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the property |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::hasProperty ( $name ) |
implementsInterface
Returns whether this class implements a given interface
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$interface |
string|ReflectionClass | Name or ReflectionClass object of the interface |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::implementsInterface ( $interface ) |
inNamespace
Returns whether this class is defined in a namespace
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::inNamespace ( ) |
isAbstract
Returns whether this class is abstract
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isAbstract ( ) |
isFinal
Returns whether this class is final
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isFinal ( ) |
isInstance
Returns whether the given object is an instance of this class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$object |
object | An object to be checked |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isInstance ( $object ) |
isInstantiable
Returns whether this class is instantiable
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isInstantiable ( ) |
isInterface
Returns whether this class is an interface
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isInterface ( ) |
isInternal
Returns whether this class is an internal class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isInternal ( ) |
isIterateable
Returns whether this class is iterateable (can be used inside foreach)
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isIterateable ( ) |
isSubclassOf
Returns whether this class is a subclass of another class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$class |
string|ReflectionClass | Name or ReflectionClass object of the super class |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isSubclassOf ( $class ) |
isUserDefined
Returns whether this class is user-defined
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::isUserDefined ( ) |
newInstance
Returns an instance of this class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$argument,... |
mixed | Arguments |
$arguments |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::newInstance ( $args ) |
newInstanceArgs
Returns an instance of this class
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$arguments |
array |
Arguments |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::newInstanceArgs ( [$args = ] ) |
setStaticPropertyValue
Sets the value of a static property
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | Name of the static property |
$default |
mixed | Value |
$value |
Redefinition of:
Method | Description |
---|---|
ReflectionClass::setStaticPropertyValue ( $name, $value ) |
__call
Use overloading to call additional methods of the ReflectionClass instance given to the constructor.
Parameters:
Name | Type | Description |
---|---|---|
$method |
string | Method to be called |
$arguments |
array | Arguments that were passed |
__toString
Returns a string representation
This is purely a wrapper method, which either calls the corresponding method of the parent class or forwards the call to the ReflectionClass instance passed to the constructor.
Redefinition of:
Method | Description |
---|---|
ReflectionClass::__toString ( ) |