ClassReflectionAnalyser
class ClassReflectionAnalyser implements ClassReflectionAnalyserInterface
Class ClassReflectionAnalyser.
Traits
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.
Un-sets the current reflection class associated with object.
Enables ability to allow unsafe checks against trait names without passing a fully-qualified namespace.
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.
No description
Optional injection at instantiation of reflection class for analysis.
Details
in ClassReflectionAnalyserTrait 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.
in ClassReflectionAnalyserTrait at line line 61
$this
setReflectionClassFromClassName(
string $class)
Create and set the reflection class via a class name.
in ClassReflectionAnalyserTrait at line line 75
$this
setReflectionClassFromClassInstance(
object $class)
Create and set the reflection class via a class instance.
in ClassReflectionAnalyserTrait at line line 85
null|ReflectionClass
getReflectionClass()
in ClassReflectionAnalyserTrait at line line 95
$this
unsetReflectionClass()
Un-sets the current reflection class associated with object.
in ClassReflectionAnalyserTrait 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...
in ClassReflectionAnalyserTrait at line line 120
bool
getRequireFQN()
Returns whether the FQN is required or not.
in ClassReflectionAnalyserTrait at line line 134
bool
hasTrait(
string $traitName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Return true if the given object has the provided trait.
in ClassReflectionAnalyserTrait at line line 159
bool
hasMethod(
string $methodName,
ReflectionClass $class = null)
Returns true if the given object has the given method.
in ClassReflectionAnalyserTrait at line line 179
bool
hasProperty(
string $propertyName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Returns true if the given object has the given property.
in ClassReflectionAnalyserTrait at line line 203
ReflectionProperty[]
getProperties(
int|bool $filter = \ReflectionProperty::IS_PUBLIC)
in ClassReflectionAnalyserTrait at line line 228
array
getPropertiesPublic()
Get an array of the class's public properties.
in ClassReflectionAnalyserTrait at line line 240
array
getPropertiesProtected()
Get an array of the class's protected properties.
in ClassReflectionAnalyserTrait at line line 252
array
getPropertiesPrivate()
Get an array of the class's private properties.
in ClassReflectionAnalyserTrait at line line 267
ReflectionProperty.
setPropertyPublic(
string $property,
ReflectionClass $class = null)
Set a protected/private property as public.
in ClassReflectionAnalyserTrait at line line 291
ReflectionMethod.
setMethodPublic(
string $method,
ReflectionClass $class = null)
Set a protected/private method as public.
at line line 30
static
$this
create(
string|null $class = null)
at line line 40
__construct(
ReflectionClass $reflectionClass = null)
Optional injection at instantiation of reflection class for analysis.