Overview

Namespaces

  • TokenReflection
    • Broker
      • Backend
    • Dummy
    • Exception
    • Invalid
    • Php
    • Stream

Classes

  • Broker
  • ReflectionAnnotation
  • ReflectionBase
  • ReflectionClass
  • ReflectionConstant
  • ReflectionElement
  • ReflectionFile
  • ReflectionFileNamespace
  • ReflectionFunction
  • ReflectionFunctionBase
  • ReflectionMethod
  • ReflectionNamespace
  • ReflectionParameter
  • ReflectionProperty
  • Resolver

Interfaces

  • IReflection
  • IReflectionClass
  • IReflectionConstant
  • IReflectionExtension
  • IReflectionFunction
  • IReflectionFunctionBase
  • IReflectionMethod
  • IReflectionNamespace
  • IReflectionParameter
  • IReflectionProperty
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class ReflectionClass

Tokenized class reflection.

TokenReflection\ReflectionBase implements TokenReflection\IReflection
Extended by TokenReflection\ReflectionElement
Extended by TokenReflection\ReflectionClass implements TokenReflection\IReflectionClass
Namespace: TokenReflection
Located at ReflectionClass.php
Methods summary
public string
# getShortName( )

Returns the unqualified name (UQN).

Returns the unqualified name (UQN).

Returns

string

Implementation of

TokenReflection\IReflectionClass::getShortName()
public string
# getNamespaceName( )

Returns the namespace name.

Returns the namespace name.

Returns

string

Implementation of

TokenReflection\IReflectionClass::getNamespaceName()
public boolean
# inNamespace( )

Returns if the class is defined within a namespace.

Returns if the class is defined within a namespace.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::inNamespace()
public array
# getModifiers( )

Returns modifiers.

Returns modifiers.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getModifiers()
public boolean
# isAbstract( )

Returns if the class is abstract.

Returns if the class is abstract.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isAbstract()
public boolean
# isFinal( )

Returns if the class is final.

Returns if the class is final.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isFinal()
public boolean
# isInterface( )

Returns if the class is an interface.

Returns if the class is an interface.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isInterface()
public boolean
# isException( )

Returns if the class is an exception or its descendant.

Returns if the class is an exception or its descendant.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isException()
public boolean
# isInstantiable( )

Returns if it is possible to create an instance of this class.

Returns if it is possible to create an instance of this class.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isInstantiable()
public boolean
# isCloneable( )

Returns if objects of this class are cloneable.

Returns if objects of this class are cloneable.

Introduced in PHP 5.4.

Returns

boolean

See

http://svn.php.net/viewvc/php/php-src/trunk/ext/reflection/php_reflection.c?revision=307971&view=markup#l4059

Implementation of

TokenReflection\IReflectionClass::isCloneable()
public boolean
# isIterateable( )

Returns if the class is iterateable.

Returns if the class is iterateable.

Returns true if the class implements the Traversable interface.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isIterateable()
public boolean
# isSubclassOf( string|object $class )

Returns if the current class is a subclass of the given class.

Returns if the current class is a subclass of the given class.

Parameters

$class
string|object
$class Class name or reflection object

Returns

boolean

Throws

TokenReflection\Exception\RuntimeException
If the provided parameter is not a reflection class instance.

Implementation of

TokenReflection\IReflectionClass::isSubclassOf()
public TokenReflection\ReflectionClass|boolean
# getParentClass( )

Returns the parent class reflection.

Returns the parent class reflection.

Returns

TokenReflection\ReflectionClass|boolean

Implementation of

TokenReflection\IReflectionClass::getParentClass()
public string|null
# getParentClassName( )

Returns the parent class name.

Returns the parent class name.

Returns

string|null

Implementation of

TokenReflection\IReflectionClass::getParentClassName()
public array
# getParentClasses( )

Returns the parent classes reflections.

Returns the parent classes reflections.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getParentClasses()
public array
# getParentClassNameList( )

Returns the parent classes names.

Returns the parent classes names.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getParentClassNameList()
public boolean
# implementsInterface( string|object $interface )

Returns if the class implements the given interface.

Returns if the class implements the given interface.

Parameters

$interface
string|object
$interface Interface name or reflection object

Returns

boolean

Throws

TokenReflection\Exception\RuntimeException
If the provided parameter is not an interface.

Implementation of

TokenReflection\IReflectionClass::implementsInterface()
public array
# getInterfaces( )

Returns interface reflections.

Returns interface reflections.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getInterfaces()
public array
# getInterfaceNames( )

Returns interface names.

Returns interface names.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getInterfaceNames()
public array
# getOwnInterfaces( )

Returns reflections of interfaces implemented by this class, not its parents.

Returns reflections of interfaces implemented by this class, not its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnInterfaces()
public array
# getOwnInterfaceNames( )

Returns names of interfaces implemented by this class, not its parents.

Returns names of interfaces implemented by this class, not its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnInterfaceNames()
public TokenReflection\ReflectionMethod|null
# getConstructor( )

Returns the class constructor reflection.

Returns the class constructor reflection.

Returns

TokenReflection\ReflectionMethod|null

Implementation of

TokenReflection\IReflectionClass::getConstructor()
public TokenReflection\ReflectionMethod|null
# getDestructor( )

Returns the class destructor reflection.

Returns the class destructor reflection.

Returns

TokenReflection\ReflectionMethod|null

Implementation of

TokenReflection\IReflectionClass::getDestructor()
public boolean
# hasMethod( string $name )

Returns if the class implements the given method.

Returns if the class implements the given method.

Parameters

$name
string
$name Method name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasMethod()
public TokenReflection\ReflectionMethod
# getMethod( string $name )

Returns a method reflection.

Returns a method reflection.

Parameters

$name
string
$name Method name

Returns

TokenReflection\ReflectionMethod

Throws

TokenReflection\Exception\RuntimeException
If the requested method does not exist.

Implementation of

TokenReflection\IReflectionClass::getMethod()
public array
# getMethods( integer $filter = null )

Returns method reflections.

Returns method reflections.

Parameters

$filter
integer
$filter Methods filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getMethods()
public boolean
# hasOwnMethod( string $name )

Returns if the class implements (and not its parents) the given method.

Returns if the class implements (and not its parents) the given method.

Parameters

$name
string
$name Method name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasOwnMethod()
public array
# getOwnMethods( integer $filter = null )

Returns reflections of methods declared by this class, not its parents.

Returns reflections of methods declared by this class, not its parents.

Parameters

$filter
integer
$filter Methods filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnMethods()
public boolean
# hasTraitMethod( string $name )

Returns if the class imports the given method from traits.

Returns if the class imports the given method from traits.

Parameters

$name
string
$name Method name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasTraitMethod()
public array
# getTraitMethods( integer $filter = null )

Returns reflections of method imported from traits.

Returns reflections of method imported from traits.

Parameters

$filter
integer
$filter Methods filter

Returns

array

Throws

TokenReflection\Exception\RuntimeException
If trait method was already imported.

Implementation of

TokenReflection\IReflectionClass::getTraitMethods()
public boolean
# hasConstant( string $name )

Returns if the class defines the given constant.

Returns if the class defines the given constant.

Parameters

$name
string
$name Constant name.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasConstant()
public mixed|false
# getConstant( string $name )

Returns a constant value.

Returns a constant value.

Parameters

$name
string
$name Constant name

Returns

mixed|false

Throws

TokenReflection\Exception\RuntimeException
If the requested constant does not exist.

Implementation of

TokenReflection\IReflectionClass::getConstant()
public TokenReflection\ReflectionConstant
# getConstantReflection( string $name )

Returns a constant reflection.

Returns a constant reflection.

Parameters

$name
string
$name Constant name

Returns

TokenReflection\ReflectionConstant

Throws

TokenReflection\Exception\RuntimeException
If the requested constant does not exist.

Implementation of

TokenReflection\IReflectionClass::getConstantReflection()
public array
# getConstants( )

Returns constant values.

Returns constant values.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getConstants()
public array
# getConstantReflections( )

Returns constant reflections.

Returns constant reflections.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getConstantReflections()
public boolean
# hasOwnConstant( string $name )

Returns if the class (and not its parents) defines the given constant.

Returns if the class (and not its parents) defines the given constant.

Parameters

$name
string
$name Constant name.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasOwnConstant()
public array
# getOwnConstants( )

Returns constants declared by this class, not by its parents.

Returns constants declared by this class, not by its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnConstants()
public array
# getOwnConstantReflections( )

Returns reflections of constants declared by this class, not by its parents.

Returns reflections of constants declared by this class, not by its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnConstantReflections()
public boolean
# hasProperty( string $name )

Returns if the class defines the given property.

Returns if the class defines the given property.

Parameters

$name
string
$name Property name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasProperty()
public TokenReflection\ReflectionProperty
# getProperty( string $name )

Return a property reflection.

Return a property reflection.

Parameters

$name
string
$name Property name

Returns

TokenReflection\ReflectionProperty

Throws

TokenReflection\Exception\RuntimeException
If the requested property does not exist.

Implementation of

TokenReflection\IReflectionClass::getProperty()
public array
# getProperties( integer $filter = null )

Returns property reflections.

Returns property reflections.

Parameters

$filter
integer
$filter Properties filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getProperties()
public boolean
# hasOwnProperty( string $name )

Returns if the class (and not its parents) defines the given property.

Returns if the class (and not its parents) defines the given property.

Parameters

$name
string
$name Property name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasOwnProperty()
public array
# getOwnProperties( integer $filter = null )

Returns reflections of properties declared by this class, not its parents.

Returns reflections of properties declared by this class, not its parents.

Parameters

$filter
integer
$filter Properties filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnProperties()
public boolean
# hasTraitProperty( string $name )

Returns if the class imports the given property from traits.

Returns if the class imports the given property from traits.

Parameters

$name
string
$name Property name

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::hasTraitProperty()
public array
# getTraitProperties( integer $filter = null )

Returns reflections of properties imported from traits.

Returns reflections of properties imported from traits.

Parameters

$filter
integer
$filter Properties filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getTraitProperties()
public array
# getDefaultProperties( )

Returns default properties.

Returns default properties.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getDefaultProperties()
public array
# getStaticProperties( )

Returns static properties reflections.

Returns static properties reflections.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getStaticProperties()
public mixed
# getStaticPropertyValue( string $name, mixed $default = null )

Returns a value of a static property.

Returns a value of a static property.

Parameters

$name
string
$name Property name
$default
mixed
$default Default value

Returns

mixed

Throws

TokenReflection\Exception\RuntimeException
If the requested static property does not exist.
TokenReflection\Exception\RuntimeException
If the requested static property is not accessible.

Implementation of

TokenReflection\IReflectionClass::getStaticPropertyValue()
public array
# getTraits( )

Returns traits used by this class.

Returns traits used by this class.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getTraits()
public array
# getOwnTraits( )

Returns traits used by this class and not its parents.

Returns traits used by this class and not its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnTraits()
public array
# getTraitNames( )

Returns names of used traits.

Returns names of used traits.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getTraitNames()
public array
# getOwnTraitNames( )

Returns names of traits used by this class an not its parents.

Returns names of traits used by this class an not its parents.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getOwnTraitNames()
public array
# getTraitAliases( )

Returns method aliases from traits.

Returns method aliases from traits.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getTraitAliases()
public boolean
# isTrait( )

Returns if the class is a trait.

Returns if the class is a trait.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isTrait()
public boolean
# isValid( )

Returns if the class definition is valid.

Returns if the class definition is valid.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isValid()
public boolean
# usesTrait( ReflectionClass|TokenReflection\IReflectionClass|string $trait )

Returns if the class uses a particular trait.

Returns if the class uses a particular trait.

Parameters

$trait
ReflectionClass|TokenReflection\IReflectionClass|string
$trait Trait reflection or name

Returns

boolean

Throws

TokenReflection\Exception\RuntimeException
If an invalid parameter was provided.

Implementation of

TokenReflection\IReflectionClass::usesTrait()
public array
# getDirectSubclasses( )

Returns reflections of direct subclasses.

Returns reflections of direct subclasses.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getDirectSubclasses()
public array
# getDirectSubclassNames( )

Returns names of direct subclasses.

Returns names of direct subclasses.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getDirectSubclassNames()
public array
# getIndirectSubclasses( )

Returns reflections of indirect subclasses.

Returns reflections of indirect subclasses.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getIndirectSubclasses()
public array
# getIndirectSubclassNames( )

Returns names of indirect subclasses.

Returns names of indirect subclasses.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getIndirectSubclassNames()
public array
# getDirectImplementers( )

Returns reflections of classes directly implementing this interface.

Returns reflections of classes directly implementing this interface.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getDirectImplementers()
public array
# getDirectImplementerNames( )

Returns names of classes directly implementing this interface.

Returns names of classes directly implementing this interface.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getDirectImplementerNames()
public array
# getIndirectImplementers( )

Returns reflections of classes indirectly implementing this interface.

Returns reflections of classes indirectly implementing this interface.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getIndirectImplementers()
public array
# getIndirectImplementerNames( )

Returns names of classes indirectly implementing this interface.

Returns names of classes indirectly implementing this interface.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getIndirectImplementerNames()
public boolean
# isInstance( object $object )

Returns if the given object is an instance of this class.

Returns if the given object is an instance of this class.

Parameters

$object
object
$object Instance

Returns

boolean

Throws

TokenReflection\Exception\RuntimeException
If the provided argument is not an object.

Implementation of

TokenReflection\IReflectionClass::isInstance()
public object
# newInstanceWithoutConstructor( )

Creates a new class instance without using a constructor.

Creates a new class instance without using a constructor.

Returns

object

Throws

TokenReflection\Exception\RuntimeException
If the class inherits from an internal class.

Implementation of

TokenReflection\IReflectionClass::newInstanceWithoutConstructor()
public object
# newInstance( mixed $args )

Creates a new instance using variable number of parameters.

Creates a new instance using variable number of parameters.

Use any number of constructor parameters as function parameters.

Parameters

$args
mixed
$args

Returns

object

Implementation of

TokenReflection\IReflectionClass::newInstance()
public object
# newInstanceArgs( array $args = array() )

Creates a new instance using an array of parameters.

Creates a new instance using an array of parameters.

Parameters

$args
array
$args Array of constructor parameters

Returns

object

Throws

TokenReflection\Exception\RuntimeException
If the required class does not exist.

Implementation of

TokenReflection\IReflectionClass::newInstanceArgs()
public
# setStaticPropertyValue( string $name, mixed $value )

Sets a static property value.

Sets a static property value.

Parameters

$name
string
$name Property name
$value
mixed
$value Property value

Throws

TokenReflection\Exception\RuntimeException
If the requested static property does not exist.
TokenReflection\Exception\RuntimeException
If the requested static property is not accessible.

Implementation of

TokenReflection\IReflectionClass::setStaticPropertyValue()
public string
# __toString( )

Returns the string representation of the reflection object.

Returns the string representation of the reflection object.

Returns

string

Implementation of

TokenReflection\IReflectionClass::__toString()
public static string|null
# export( TokenReflection\Broker $broker, string|object $className, boolean $return = false )

Exports a reflected object.

Exports a reflected object.

Parameters

$broker
TokenReflection\Broker
$broker Broker instance
$className
string|object
$className Class name or class instance
$return
boolean
$return Return the export instead of outputting it

Returns

string|null

Throws

TokenReflection\Exception\RuntimeException
If requested parameter doesn't exist.
public boolean
# isComplete( )

Returns if the class definition is complete.

Returns if the class definition is complete.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isComplete()
public array
# getNamespaceAliases( )

Returns imported namespaces and aliases from the declaring namespace.

Returns imported namespaces and aliases from the declaring namespace.

Returns

array

Implementation of

TokenReflection\IReflectionClass::getNamespaceAliases()
protected TokenReflection\ReflectionClass
# processParent( TokenReflection\IReflection $parent, TokenReflection\Stream\StreamBase $tokenStream )

Processes the parent reflection object.

Processes the parent reflection object.

Parameters

$parent
TokenReflection\IReflection
$parent Parent reflection object
$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream

Returns

TokenReflection\ReflectionClass

Throws

TokenReflection\ParseException
On invalid parent reflection provided

Overrides

TokenReflection\ReflectionElement::processParent()
protected TokenReflection\ReflectionClass
# parse( TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\IReflection $parent )

Parses reflected element metadata from the token stream.

Parses reflected element metadata from the token stream.

Parameters

$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream
$parent
TokenReflection\IReflection
$parent Parent reflection object

Returns

TokenReflection\ReflectionClass
protected TokenReflection\ReflectionClass
# parseName( TokenReflection\Stream\StreamBase $tokenStream )

Parses the class/interface name.

Parses the class/interface name.

Parameters

$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream

Returns

TokenReflection\ReflectionClass

Throws

TokenReflection\Exception\ParseException
If the class name could not be determined.
protected TokenReflection\ReflectionClass
# parseChildren( TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\IReflection $parent )

Parses child reflection objects from the token stream.

Parses child reflection objects from the token stream.

Parameters

$tokenStream
TokenReflection\Stream\StreamBase
$tokenStream Token substream
$parent
TokenReflection\IReflection
$parent Parent reflection object

Returns

TokenReflection\ReflectionClass

Throws

TokenReflection\Exception\ParseException
If a parse error was detected.

Overrides

TokenReflection\ReflectionElement::parseChildren()
Methods inherited from TokenReflection\ReflectionElement
__construct(), getDocblockTemplates(), getEndLine(), getEndPosition(), getExtension(), getExtensionName(), getFileName(), getFileReflection(), getSource(), getStartLine(), getStartPosition(), parseDocComment(), parseStream()
Methods inherited from TokenReflection\ReflectionBase
__get(), __isset(), exists(), get(), getAnnotation(), getAnnotations(), getBroker(), getDocComment(), getName(), getPrettyName(), hasAnnotation(), isDeprecated(), isInternal(), isTokenized(), isUserDefined()
Constants summary
integer IS_INTERFACE 0x80
#

Modifier for determining if the reflected object is an interface.

Modifier for determining if the reflected object is an interface.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l122
integer IS_TRAIT 0x120
#

Modifier for determining if the reflected object is a trait.

Modifier for determining if the reflected object is a trait.

See

http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_compile.h?revision=306938&view=markup#l150
integer IMPLEMENTS_INTERFACES 0x80000
#

Class implements interfaces.

Class implements interfaces.

See

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.h?revision=306939&view=markup#l152
integer IMPLEMENTS_TRAITS 0x400000
#

Class implements traits.

Class implements traits.

See

http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_compile.h?revision=306938&view=markup#l181
Constants inherited from TokenReflection\ReflectionElement
DOCBLOCK_TEMPLATE_END, DOCBLOCK_TEMPLATE_START
Properties inherited from TokenReflection\ReflectionElement
$docblockTemplates, $startPosition
Properties inherited from TokenReflection\ReflectionBase
$docComment, $name
PHP Token Reflection API documentation generated by ApiGen 2.8.0