Documentation

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

$magicConstants

private static mixed $magicConstants = ['__LINE__', '__FILE__', '__DIR__', '__FUNCTION__', '__CLASS__', '__TRAIT__', '__METHOD__', '__NAMESPACE__', '__COMPILER_HALT_OFFSET__']

Methods

__construct()

Construct a ReflectionConstant_ object.

public __construct(string $name) : mixed
Parameters
$name : string
Return values
mixed

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
throws
RuntimeException
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
throws
RuntimeException
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
Return values
mixed

Search results