class ReflectionHelper

Methods

static bool
hasPropertyTag(ClassReflection $classReflection, string $propertyName)

Determine whether the given class or its ancestors declare the property with an @property* tag, or a mixin has it.

static bool
hasMethodTag(ClassReflection $classReflection, string $methodName)

Determine whether the given class or its ancestors declare the method with an @method tag, or a mixin has it.

static bool
isFacade(Name $class, string $facade, string $alias)

Determine whether the static call target names the given facade.

static array|null
findClassAttribute(ClassReflection $classReflection, string $attributeClass)

Find a class attribute as the runtime reads it: on each class of the hierarchy, then the traits it uses directly, then its parent (ClassMetadataCache::getAttribute() and Model::resolveClassAttribute()).

Details

at line 29
static bool hasPropertyTag(ClassReflection $classReflection, string $propertyName)

Determine whether the given class or its ancestors declare the property with an @property* tag, or a mixin has it.

Parameters

ClassReflection $classReflection
string $propertyName

Return Value

bool

at line 64
static bool hasMethodTag(ClassReflection $classReflection, string $methodName)

Determine whether the given class or its ancestors declare the method with an @method tag, or a mixin has it.

Parameters

ClassReflection $classReflection
string $methodName

Return Value

bool

at line 102
static bool isFacade(Name $class, string $facade, string $alias)

Determine whether the static call target names the given facade.

Matches the facade itself, a subclass of it, and the root namespace alias Hypervel registers for it (\Bus, \DB, ...).

Parameters

Name $class
string $facade
string $alias

Return Value

bool

at line 123
static array|null findClassAttribute(ClassReflection $classReflection, string $attributeClass)

Find a class attribute as the runtime reads it: on each class of the hierarchy, then the traits it uses directly, then its parent (ClassMetadataCache::getAttribute() and Model::resolveClassAttribute()).

Return the attribute, the class the runtime treats as declaring it (the using class for a trait's attribute), and the class or trait whose source declares it.

Parameters

ClassReflection $classReflection
string $attributeClass

Return Value

array|null