ConstantDefinitionNode
interface ConstantDefinitionNode (View source)
Parser-agnostic interface for global constant definition AST nodes.
Represents define() function calls that define global constants.
Methods
string
getName()
Get the constant name.
mixed
getValue()
Get the constant value as a plain PHP scalar.
DocCommentNode|null
getDocComment()
Get the doc comment node attached to this constant definition, or null if none.
string
getNamespace()
Get the namespace where this constant is defined.
void
setNamespace(string $namespace)
Set the namespace for this constant.
Details
string
getName()
Get the constant name.
mixed
getValue()
Get the constant value as a plain PHP scalar.
Returns null for complex expressions that cannot be statically evaluated.
DocCommentNode|null
getDocComment()
Get the doc comment node attached to this constant definition, or null if none.
string
getNamespace()
Get the namespace where this constant is defined.
void
setNamespace(string $namespace)
Set the namespace for this constant.