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 ReflectionConstant

Reflection of a not tokenized but defined constant.

TokenReflection\Php\ReflectionConstant implements TokenReflection\Php\IReflection, TokenReflection\IReflectionConstant
Namespace: TokenReflection\Php
Located at Php/ReflectionConstant.php
Methods summary
public
# __construct( string $name, mixed $value, TokenReflection\Broker $broker, TokenReflection\Php\ReflectionClass $parent = null )

Constructor.

Constructor.

Parameters

$name
string
$name Constant name
$value
mixed
$value Constant value
$broker
TokenReflection\Broker
$broker Reflection broker
$parent
TokenReflection\Php\ReflectionClass
$parent Defining class reflection

Throws

TokenReflection\Exception\RuntimeException
If real parent class could not be determined.
public string
# getName( )

Returns the name.

Returns the name.

Returns

string

Implementation of

TokenReflection\IReflection::getName()
public string
# getShortName( )

Returns the unqualified name (UQN).

Returns the unqualified name (UQN).

Returns

string

Implementation of

TokenReflection\IReflectionConstant::getShortName()
public TokenReflection\IReflectionClass|null
# getDeclaringClass( )

Returns the declaring class reflection.

Returns the declaring class reflection.

Returns

TokenReflection\IReflectionClass|null

Implementation of

TokenReflection\IReflectionConstant::getDeclaringClass()
public string|null
# getDeclaringClassName( )

Returns the declaring class name.

Returns the declaring class name.

Returns

string|null

Implementation of

TokenReflection\IReflectionConstant::getDeclaringClassName()
public string
# getNamespaceName( )

Returns the namespace name.

Returns the namespace name.

Returns

string

Implementation of

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

Returns if the function/method is defined within a namespace.

Returns if the function/method is defined within a namespace.

Returns

boolean

Implementation of

TokenReflection\IReflectionConstant::inNamespace()
public null
# getExtension( )

Returns the PHP extension reflection.

Returns the PHP extension reflection.

Returns

null
public boolean
# getExtensionName( )

Returns the PHP extension name.

Returns the PHP extension name.

Returns

boolean
public null
# getFileName( )

Returns the file name the reflection object is defined in.

Returns the file name the reflection object is defined in.

Returns

null

Implementation of

TokenReflection\IReflectionConstant::getFileName()
public null
# getStartLine( )

Returns the definition start line number in the file.

Returns the definition start line number in the file.

Returns

null

Implementation of

TokenReflection\IReflectionConstant::getStartLine()
public null
# getEndLine( )

Returns the definition end line number in the file.

Returns the definition end line number in the file.

Returns

null

Implementation of

TokenReflection\IReflectionConstant::getEndLine()
public boolean
# getDocComment( )

Returns the appropriate docblock definition.

Returns the appropriate docblock definition.

Returns

boolean

Implementation of

TokenReflection\IReflectionConstant::getDocComment()
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 mixed
# getValue( )

Returns the constant value.

Returns the constant value.

Returns

mixed

Implementation of

TokenReflection\IReflectionConstant::getValue()
public string
# getValueDefinition( )

Returns the part of the source code defining the constant value.

Returns the part of the source code defining the constant value.

Returns

string

Implementation of

TokenReflection\IReflectionConstant::getValueDefinition()
public string
# getOriginalValueDefinition( )

Returns the originaly provided value definition.

Returns the originaly provided value definition.

Returns

string
public boolean
# isInternal( )

Returns if the constant is internal.

Returns if the constant is internal.

Returns

boolean

Implementation of

TokenReflection\IReflection::isInternal()
public boolean
# isUserDefined( )

Returns if the constant is user defined.

Returns if the constant is user defined.

Returns

boolean

Implementation of

TokenReflection\IReflection::isUserDefined()
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\IReflectionConstant::isDeprecated()
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 string
# __toString( )

Returns the string representation of the reflection object.

Returns the string representation of the reflection object.

Returns

string

Implementation of

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

Exports a reflected object.

Exports a reflected object.

Parameters

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

Returns

string|null

Throws

TokenReflection\Exception\RuntimeException
If requested parameter doesn't exist.
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()
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\IReflectionConstant::getNamespaceAliases()
public boolean
# isValid( )

Returns if the constant definition is valid.

Returns if the constant definition is valid.

Internal constants are always valid.

Returns

boolean

Implementation of

TokenReflection\IReflectionConstant::isValid()
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 static null
# create( Reflector $internalReflection, TokenReflection\Broker $broker )

Creates a reflection instance.

Creates a reflection instance.

Not supported for constants since there is no internal constant reflection.

Parameters

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

Returns

null

Implementation of

TokenReflection\Php\IReflection::create()
PHP Token Reflection API documentation generated by ApiGen 2.8.0