ClassReflectionAnalyserTrait
trait ClassReflectionAnalyserTrait
Class ClassReflectionAnalyserTrait.
Methods
Set the current reflection class to operate on (can be overridden by directly passing a reflection class to any of the has[Trait|Method|Property] methods.
Create and set the reflection class via a class name.
Create and set the reflection class via a class instance.
No description
Un-sets the current reflection class associated with object.
Enables ability to allow unsafe checks against trait names without passing a fully-qualified namespace.
Returns whether the FQN is required or not.
Return true if the given object has the provided trait.
Returns true if the given object has the given method.
Returns true if the given object has the given property.
No description
Get an array of the class's public properties.
Get an array of the class's protected properties.
Get an array of the class's private properties.
Set a protected/private property as public.
Set a protected/private method as public.
Details
at line line 47
$this
setReflectionClass(
ReflectionClass $reflectionClass = null)
Set the current reflection class to operate on (can be overridden by directly passing a reflection class to any of the has[Trait|Method|Property] methods.
at line line 61
$this
setReflectionClassFromClassName(
string $class)
Create and set the reflection class via a class name.
at line line 75
$this
setReflectionClassFromClassInstance(
object $class)
Create and set the reflection class via a class instance.
at line line 85
null|ReflectionClass
getReflectionClass()
at line line 95
$this
unsetReflectionClass()
Un-sets the current reflection class associated with object.
at line line 110
$this
setRequireFQN(
bool $requireFQN = true)
Enables ability to allow unsafe checks against trait names without passing a fully-qualified namespace.
Use at your own risk...
at line line 120
bool
getRequireFQN()
Returns whether the FQN is required or not.
at line line 134
bool
hasTrait(
string $traitName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Return true if the given object has the provided trait.
at line line 159
bool
hasMethod(
string $methodName,
ReflectionClass $class = null)
Returns true if the given object has the given method.
at line line 179
bool
hasProperty(
string $propertyName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Returns true if the given object has the given property.
at line line 203
ReflectionProperty[]
getProperties(
int|bool $filter = \ReflectionProperty::IS_PUBLIC)
at line line 228
array
getPropertiesPublic()
Get an array of the class's public properties.
at line line 240
array
getPropertiesProtected()
Get an array of the class's protected properties.
at line line 252
array
getPropertiesPrivate()
Get an array of the class's private properties.
at line line 267
ReflectionProperty.
setPropertyPublic(
string $property,
ReflectionClass $class = null)
Set a protected/private property as public.
at line line 291
ReflectionMethod.
setMethodPublic(
string $method,
ReflectionClass $class = null)
Set a protected/private method as public.