ReflectionClassConstant
class ReflectionClassConstant implements Reflector (View source)
The ReflectionClassConstant class reports information about a class constant.
Constants
|
IS_PUBLIC
Since: 8.0
|
Indicates that the constant is public. |
|
IS_PROTECTED
Since: 8.0
|
Indicates that the constant is protected. |
|
IS_PRIVATE
Since: 8.0
|
Indicates that the constant is private. |
|
IS_FINAL
Since: 8.1
|
|
Properties
| string | $name | ||
| class-string | $class | ||
|
bool
Since: 8.1
|
$isFinal |
Methods
ReflectionClassConstant constructor.
Export
Gets declaring class
Gets doc comments
Gets the class constant modifiers
Get name of the constant
Gets value
Checks if class constant is private
Checks if class constant is protected
Checks if class constant is public
Returns the string representation of the ReflectionClassConstant object.
Gets Attributes
Checks if class constant is an Enum case
Checks if class constant is final
Checks if class constant has a type
Gets a class constant's type
Checks if deprecated
Details
__construct(class-string|object $class, string $constant)
ReflectionClassConstant constructor.
static string|null
export(string|object $class, string $name, bool $return = false)
Export
Exports a reflection.
ReflectionClass
getDeclaringClass()
Gets declaring class
string|false
getDocComment()
Gets doc comments
int
getModifiers()
Gets the class constant modifiers
string
getName()
Get name of the constant
mixed
getValue()
Gets value
bool
isPrivate()
Checks if class constant is private
bool
isProtected()
Checks if class constant is protected
bool
isPublic()
Checks if class constant is public
string
__toString()
Returns the string representation of the ReflectionClassConstant object.
array
getAttributes(string|null $name = null, int $flags = 0)
Gets Attributes
Returns all attributes declared on this class constant as an array of ReflectionAttribute.
bool
isEnumCase()
Checks if class constant is an Enum case
Checks if the class constant is an Enum case.
bool
isFinal()
Checks if class constant is final
Checks if the class constant is final.
bool
hasType()
Checks if class constant has a type
Checks if the class constant has a type associated with it.
ReflectionType|null
getType()
Gets a class constant's type
Gets the associated type of a class constant.
bool
isDeprecated()
Checks if deprecated
Checks whether the class constant is deprecated.