Reflection
final class Reflection
PHP reflection helpers.
Methods
No description
Returns the default value of a parameter. Resolves constants and class constants used as default values.
Returns a reflection of a class or trait that contains a declaration of given property. Property can also be declared in the trait.
Returns a reflection of a method that contains a declaration of $method.
Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache.
Expands the name of the class to full name in the given context of given class.
Returns the use statements from the file where the class is defined.
Details
at line 23
static bool
isBuiltinType(string $type)
deprecated
deprecated
No description
at line 29
static bool
isClassKeyword(string $name)
No description
at line 40
static mixed
getParameterDefaultValue(ReflectionParameter $param)
Returns the default value of a parameter. Resolves constants and class constants used as default values.
at line 75
static ReflectionClass
getPropertyDeclaringClass(ReflectionProperty $prop)
Returns a reflection of a class or trait that contains a declaration of given property. Property can also be declared in the trait.
at line 94
static ReflectionMethod
getMethodDeclaringMethod(ReflectionMethod $method)
Returns a reflection of a method that contains a declaration of $method.
Usually, each method is its own declaration, but the body of the method can also be in the trait and under a different name.
at line 129
static bool
areCommentsAvailable()
Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache.
at line 139
static string
toString(Reflector $ref)
Returns a human-readable string representation of a reflection object.
at line 163
static string
expandClassName(string $name, ReflectionClass $context)
Expands the name of the class to full name in the given context of given class.
Thus, it returns how the PHP parser would understand $name if it were written in the body of the class $context.
at line 204
static array
getUseStatements(ReflectionClass $class)
Returns the use statements from the file where the class is defined.
Traits
Prevents instantiation.