final class Reflection

PHP reflection helpers.

Methods

static bool
isBuiltinType(string $type) deprecated

No description

static bool
isClassKeyword(string $name) deprecated

No description

static mixed
getParameterDefaultValue(ReflectionParameter $param) deprecated

No description

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.

getMethodDeclaringMethod(ReflectionMethod $method)

Returns a reflection of a method that contains a declaration of $method.

static bool
areCommentsAvailable()

Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache.

static string
toString(Reflector $ref)

No description

static string
expandClassName(string $name, ReflectionClass $context)

Expands the name of the class to full name in the given context of given class.

static array
getUseStatements(ReflectionClass $class)

No description

Details

at line 23
static bool isBuiltinType(string $type) deprecated

deprecated use Nette\Utils\Validator::isBuiltinType()

No description

Parameters

string $type

Return Value

bool

at line 30
static bool isClassKeyword(string $name) deprecated

deprecated use Nette\Utils\Validator::isClassKeyword()

No description

Parameters

string $name

Return Value

bool

at line 37
static mixed getParameterDefaultValue(ReflectionParameter $param) deprecated

deprecated use native ReflectionParameter::getDefaultValue()

No description

Parameters

ReflectionParameter $param

Return Value

mixed

at line 71
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.

Parameters

ReflectionProperty $prop

Return Value

ReflectionClass

at line 90
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.

Parameters

ReflectionMethod $method

Return Value

ReflectionMethod

at line 125
static bool areCommentsAvailable()

Finds out if reflection has access to PHPdoc comments. Comments may not be available due to the opcode cache.

Return Value

bool

at line 132
static string toString(Reflector $ref)

No description

Parameters

Reflector $ref

Return Value

string

at line 157
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.

Parameters

string $name
ReflectionClass $context

Return Value

string

Exceptions

InvalidArgumentException

at line 194
static array getUseStatements(ReflectionClass $class)

No description

Parameters

ReflectionClass $class

Return Value

array

of [alias => class]

Traits

Static class.