Overview

Namespaces

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

Classes

  • ReflectionClass
  • ReflectionConstant
  • ReflectionExtension
  • ReflectionFunction
  • ReflectionMethod
  • ReflectionParameter
  • ReflectionProperty

Interfaces

  • IReflection
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class ReflectionClass

Reflection of a not tokenized but defined class.

Descendant of the internal reflection with additional features.

ReflectionClass implements Reflector
Extended by TokenReflection\Php\ReflectionClass implements TokenReflection\Php\IReflection, TokenReflection\IReflectionClass
Namespace: TokenReflection\Php
Located at Php/ReflectionClass.php
Methods summary
public
# __construct( string $className, TokenReflection\Broker $broker )

Constructor.

Constructor.

Parameters

$className
string
$className Class name
$broker
TokenReflection\Broker
$broker Reflection broker

Overrides

ReflectionClass::__construct()
public TokenReflection\Php\ReflectionExtension
# getExtension( )

Returns the PHP extension reflection.

Returns the PHP extension reflection.

Returns

TokenReflection\Php\ReflectionExtension

Overrides

ReflectionClass::getExtension()

Implementation of

TokenReflection\IReflectionClass::getExtension()
public boolean
# hasAnnotation( string $name )

Checks if there is a particular annotation.

Checks if there is a particular annotation.

Parameters

$name
string
$name Annotation name

Returns

boolean
public null
# getAnnotation( string $name )

Returns a particular annotation value.

Returns a particular annotation value.

Parameters

$name
string
$name Annotation name

Returns

null
public array
# getAnnotations( )

Returns parsed docblock.

Returns parsed docblock.

Returns

array
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
# 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
# isTokenized( )

Returns if the current reflection comes from a tokenized source.

Returns if the current reflection comes from a tokenized source.

Returns

boolean

Implementation of

TokenReflection\IReflection::isTokenized()
public boolean
# isDeprecated( )

Returns if the reflection subject is deprecated.

Returns if the reflection subject is deprecated.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isDeprecated()
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 an invalid parameter was provided.

Overrides

ReflectionClass::isSubclassOf()

Implementation of

TokenReflection\IReflectionClass::isSubclassOf()
public TokenReflection\Php\ReflectionClass
# getParentClass( )

Returns parent class reflection.

Returns parent class reflection.

Returns

TokenReflection\Php\ReflectionClass

Overrides

ReflectionClass::getParentClass()

Implementation of

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

Returns the parent class name.

Returns the parent class name.

Returns

string

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.

Overrides

ReflectionClass::implementsInterface()

Implementation of

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

Returns an array of interface reflections.

Returns an array of interface reflections.

Returns

array

Overrides

ReflectionClass::getInterfaces()

Implementation of

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

Returns interfaces implemented by this class, not its parents.

Returns 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\Php\ReflectionClass|null
# getConstructor( )

Returns class constructor reflection.

Returns class constructor reflection.

Returns

TokenReflection\Php\ReflectionClass|null

Overrides

ReflectionClass::getConstructor()

Implementation of

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

Returns class desctructor reflection.

Returns class desctructor reflection.

Returns

TokenReflection\Php\ReflectionClass|null

Implementation of

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

Returns a particular method reflection.

Returns a particular method reflection.

Parameters

$name
string
$name Method name

Returns

TokenReflection\Php\ReflectionMethod

Throws

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

Overrides

ReflectionClass::getMethod()

Implementation of

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

Returns class methods.

Returns class methods.

Parameters

$filter
integer
$filter Methods filter

Returns

array

Overrides

ReflectionClass::getMethods()

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 methods declared by this class, not its parents.

Returns methods declared by this class, not its parents.

Parameters

$filter
integer
$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 method reflections imported from traits.

Returns method reflections imported from traits.

Parameters

$filter
integer
$filter Methods filter

Returns

array

Implementation of

TokenReflection\IReflectionClass::getTraitMethods()
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
# getConstantReflections( )

Returns an array of constant reflections.

Returns an array of 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 its parents.

Returns constants declared by this class, not its parents.

Returns

array

Implementation of

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

Returns an array of constant reflections defined by this class and not its parents.

Returns an array of constant reflections defined by this class and not its parents.

Returns

array

Implementation of

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

Returns a particular property reflection.

Returns a particular property reflection.

Parameters

$name
string
$name Property name

Returns

TokenReflection\Php\ReflectionProperty

Throws

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

Overrides

ReflectionClass::getProperty()

Implementation of

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

Returns class properties.

Returns class properties.

Parameters

$filter
integer
$filter Properties filter

Returns

array

Overrides

ReflectionClass::getProperties()

Implementation of

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

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

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

Parameters

$name
string
$name Property name

Returns

boolean

Implementation of

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

Returns properties declared by this class, not its parents.

Returns properties declared by this class, not its parents.

Parameters

$filter
integer
$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 property reflections imported from traits.

Returns property reflections imported from traits.

Parameters

$filter
integer
$filter Properties filter

Returns

array

Implementation of

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

Returns static properties reflections.

Returns static properties reflections.

Returns

array

Overrides

ReflectionClass::getStaticProperties()

Implementation of

TokenReflection\IReflectionClass::getStaticProperties()
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
# isComplete( )

Returns if the class definition is complete.

Returns if the class definition is complete.

Internal classes always have the definition complete.

Returns

boolean

Implementation of

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

Returns if the class definition is valid.

Returns if the class definition is valid.

Internal classes are always valid.

Returns

boolean

Implementation of

TokenReflection\IReflectionClass::isValid()
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()
public TokenReflection\Broker
# getBroker( )

Returns the reflection broker used by this reflection object.

Returns the reflection broker used by this reflection object.

Returns

TokenReflection\Broker

Implementation of

TokenReflection\IReflection::getBroker()
final public mixed
# __get( string $key )

Magic __get method.

Magic __get method.

Parameters

$key
string
$key Variable name

Returns

mixed

Implementation of

TokenReflection\IReflection::__get()
final public boolean
# __isset( string $key )

Magic __isset method.

Magic __isset method.

Parameters

$key
string
$key Variable name

Returns

boolean

Implementation of

TokenReflection\IReflection::__isset()
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 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::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
# 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 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 string
# getPrettyName( )

Returns an element pretty (docblock compatible) name.

Returns an element pretty (docblock compatible) name.

Returns

string

Implementation of

TokenReflection\IReflection::getPrettyName()
public static TokenReflection\Php\ReflectionClass
# create( Reflector $internalReflection, TokenReflection\Broker $broker )

Creates a reflection instance.

Creates a reflection instance.

Parameters

$internalReflection
ReflectionClass
$internalReflection Internal reflection instance
$broker
TokenReflection\Broker
$broker Reflection broker instance

Returns

TokenReflection\Php\ReflectionClass

Throws

TokenReflection\Exception\RuntimeException
If an invalid internal reflection object was provided.

Implementation of

TokenReflection\Php\IReflection::create()
Methods inherited from ReflectionClass
__toString(), export(), getConstant(), getConstants(), getDefaultProperties(), getDocComment(), getEndLine(), getExtensionName(), getFileName(), getInterfaceNames(), getModifiers(), getName(), getNamespaceName(), getShortName(), getStartLine(), getStaticPropertyValue(), hasConstant(), hasMethod(), hasProperty(), inNamespace(), isAbstract(), isFinal(), isInstance(), isInstantiable(), isInterface(), isInternal(), isIterateable(), isUserDefined(), newInstance(), newInstanceArgs(), setStaticPropertyValue()
Constants inherited from ReflectionClass
IS_EXPLICIT_ABSTRACT, IS_FINAL, IS_IMPLICIT_ABSTRACT
Properties inherited from ReflectionClass
$name
PHP Token Reflection API documentation generated by ApiGen 2.8.0