ReflectionConstant_
in package
implements
Reflector
Somehow the standard reflection library doesn't include constants.
ReflectionConstant_ corrects that omission.
Note: For backwards compatibility reasons, this class is named ReflectionConstant_ rather than ReflectionConstant. It will be renamed in v0.10.0.
Interfaces, Classes and Traits
- Reflector
Table of Contents
- $name : mixed
- $magicConstants : mixed
- $value : mixed
- __construct() : mixed
- Construct a ReflectionConstant_ object.
- __toString() : string
- To string.
- export() : null|string
- Exports a reflection.
- getDocComment() : false
- Get the constant's docblock.
- getEndLine() : mixed
- Get the code end line.
- getFileName() : mixed
- Gets the constant's file name.
- getName() : string
- Gets the constant name.
- getNamespaceName() : string
- Gets the namespace name.
- getStartLine() : mixed
- Get the code start line.
- getValue() : mixed
- Gets the value of the constant.
- inNamespace() : bool
- Checks if this constant is defined in a namespace.
- isMagicConstant() : mixed
Properties
$name
public
mixed
$name
$magicConstants
private
static mixed
$magicConstants
= ['__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__', '__TRAIT__', '__METHOD__', '__NAMESPACE__', '__COMPILER_HALT_OFFSET__']
$value
private
mixed
$value
Methods
__construct()
Construct a ReflectionConstant_ object.
public
__construct(string $name) : mixed
Parameters
- $name : string
Return values
mixed —__toString()
To string.
public
__toString() : string
Return values
string —export()
Exports a reflection.
public
static export(string $name[, bool $return = false ]) : null|string
Parameters
- $name : string
- $return : bool = false
-
pass true to return the export, as opposed to emitting it
Return values
null|string —getDocComment()
Get the constant's docblock.
public
getDocComment() : false
Return values
false —getEndLine()
Get the code end line.
public
getEndLine() : mixed
Tags
Return values
mixed —getFileName()
Gets the constant's file name.
public
getFileName() : mixed
Currently returns null, because if it returns a file name the signature formatter will barf.
Return values
mixed —getName()
Gets the constant name.
public
getName() : string
Return values
string —getNamespaceName()
Gets the namespace name.
public
getNamespaceName() : string
Returns '' when the constant is not namespaced.
Return values
string —getStartLine()
Get the code start line.
public
getStartLine() : mixed
Tags
Return values
mixed —getValue()
Gets the value of the constant.
public
getValue() : mixed
Return values
mixed —inNamespace()
Checks if this constant is defined in a namespace.
public
inNamespace() : bool
Return values
bool —isMagicConstant()
public
static isMagicConstant(mixed $name) : mixed
Parameters
- $name : mixed