Extends the ReflectionObject class to provide type information using PHPDoc annotations.
Source for this file: /Reflection/src/object.php
ReflectionObject | --ezcReflectionObject
Version: | //autogen// |
From ReflectionObject (Internal Class): | |
---|---|
IS_EXPLICIT_ABSTRACT = 32
|
|
IS_FINAL = 64
|
|
IS_IMPLICIT_ABSTRACT = 16
|
protected ezcReflectionDocCommentParser |
$docParser
|
protected object|ReflectionObject |
$reflectionSource
|
From ReflectionObject (Internal Class) | |
---|---|
public |
$name
|
public static mixed |
export(
$object
, [ $return
= false] )
Exports a ReflectionObject instance. |
public ezcReflectionObject |
__construct(
$argument
)
Constructs a new ezcReflectionObject. |
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 ReflectionObject instance given to the constructor. |
public string |
__toString(
)
Returns a string representation |
From ReflectionObject (Internal Class) | |
---|---|
public ReflectionObject |
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 ( )
|
Exports a ReflectionObject 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 (ReflectionObject::export()).
Name | Type | Description |
---|---|---|
$object |
ReflectionObject | ReflectionClass instance of the object |
$return |
boolean | Whether to return (TRUE) or print (FALSE) the output |
Method | Description |
---|---|
ReflectionObject::export ( $argument, [$return = ] ) |
Constructs a new ezcReflectionObject.
Name | Type | Description |
---|---|---|
$argument |
object|ReflectionObject | Instance or ReflectionObject of the object to be reflected |
Method | Description |
---|---|
ReflectionObject::constructor __construct ( $argument ) |
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.
Name | Type | Description |
---|---|---|
$method |
string | Name of the method to be invoked |
$arguments |
mixed[] | Arguments to be passed to the method |
Returns an array of annotations (optinally only annotations of a given name)
Name | Type | Description |
---|---|---|
$name |
string | Name of the annotations |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the constant |
Method | Description |
---|---|
ReflectionObject::getConstant ( $name ) |
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.
Method | Description |
---|---|
ReflectionObject::getConstants ( ) |
Returns an ezcReflectionMethod object of the constructor method.
Method | Description |
---|---|
ReflectionObject::getConstructor ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getDefaultProperties ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getDocComment ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getEndLine ( ) |
Returns NULL or the extension the class belongs to
Method | Description |
---|---|
ReflectionObject::getExtension ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getExtensionName ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getFileName ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getInterfaceNames ( ) |
Returns an array of all interfaces implemented by the class.
Method | Description |
---|---|
ReflectionObject::getInterfaces ( ) |
Returns the long description of the class from the source code documentation
Returns an ezcReflectionMethod object of the method specified by $name.
Name | Type | Description |
---|---|---|
$name |
string | Name of the method |
Type | Description |
---|---|
ReflectionException |
if method doesn't exist |
Method | Description |
---|---|
ReflectionObject::getMethod ( $name ) |
Returns the methods as an array of ezcReflectionMethod objects.
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 |
Method | Description |
---|---|
ReflectionObject::getMethods ( [$filter = ] ) |
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.
Method | Description |
---|---|
ReflectionObject::getModifiers ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getName ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getNamespaceName ( ) |
Returns the class' parent class, or, if none exists, FALSE
Method | Description |
---|---|
ReflectionObject::getParentClass ( ) |
Returns an array of this class' properties
Name | Type | Description |
---|---|---|
$filter |
integer | A combination of ReflectionProperty::IS_STATIC, ReflectionProperty::IS_PUBLIC, ReflectionProperty::IS_PROTECTED and ReflectionProperty::IS_PRIVATE |
Method | Description |
---|---|
ReflectionObject::getProperties ( [$filter = ] ) |
Returns the class' property specified by its name
Name | Type | Description |
---|---|---|
$name |
string | Name of the property |
Type | Description |
---|---|
RelectionException |
if property doesn't exist |
Method | Description |
---|---|
ReflectionObject::getProperty ( $name ) |
Returns the short description of the class from the source code documentation
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.
Method | Description |
---|---|
ReflectionObject::getShortName ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getStartLine ( ) |
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.
Method | Description |
---|---|
ReflectionObject::getStaticProperties ( ) |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the static property |
$default |
mixed | Default value |
Method | Description |
---|---|
ReflectionObject::getStaticPropertyValue ( $name, [$default = ] ) |
Checks whether the class is annotated with the annotation $annotation
Name | Type | Description |
---|---|---|
$annotation |
string | Name of the annotation |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the constant |
Method | Description |
---|---|
ReflectionObject::hasConstant ( $name ) |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the method |
Method | Description |
---|---|
ReflectionObject::hasMethod ( $name ) |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the property |
Method | Description |
---|---|
ReflectionObject::hasProperty ( $name ) |
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.
Name | Type | Description |
---|---|---|
$interface |
string|ReflectionClass | Name or ReflectionClass object of the interface |
Method | Description |
---|---|
ReflectionObject::implementsInterface ( $interface ) |
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.
Method | Description |
---|---|
ReflectionObject::inNamespace ( ) |
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.
Method | Description |
---|---|
ReflectionObject::isAbstract ( ) |
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.
Method | Description |
---|---|
ReflectionObject::isFinal ( ) |
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.
Name | Type | Description |
---|---|---|
$object |
object | An object to be checked |
Method | Description |
---|---|
ReflectionObject::isInstance ( $object ) |
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.
Method | Description |
---|---|
ReflectionObject::isInstantiable ( ) |
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.
Method | Description |
---|---|
ReflectionObject::isInterface ( ) |
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.
Method | Description |
---|---|
ReflectionObject::isInternal ( ) |
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.
Method | Description |
---|---|
ReflectionObject::isIterateable ( ) |
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.
Name | Type | Description |
---|---|---|
$class |
string|ReflectionClass | Name or ReflectionClass object of the super class |
Method | Description |
---|---|
ReflectionObject::isSubclassOf ( $class ) |
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.
Method | Description |
---|---|
ReflectionObject::isUserDefined ( ) |
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.
Name | Type | Description |
---|---|---|
$argument,... |
mixed | Arguments |
$arguments |
Method | Description |
---|---|
ReflectionObject::newInstance ( $args ) |
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.
Name | Type | Description |
---|---|---|
$arguments |
array |
Arguments |
Method | Description |
---|---|
ReflectionObject::newInstanceArgs ( [$args = ] ) |
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.
Name | Type | Description |
---|---|---|
$name |
string | Name of the static property |
$default |
mixed | Value |
$value |
Method | Description |
---|---|
ReflectionObject::setStaticPropertyValue ( $name, $value ) |
Use overloading to call additional methods of the ReflectionObject instance given to the constructor.
Name | Type | Description |
---|---|---|
$method |
string | Method to be called |
$arguments |
array | Arguments that were passed |
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.
Method | Description |
---|---|
ReflectionObject::__toString ( ) |