ClassReflectionAnalyserInterface
interface ClassReflectionAnalyserInterface
Interface ClassReflectionAnalyserInterface.
Methods
No description
Optional injection at instantiation of reflection class for analysis.
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. Passing no value effectively un-sets the internally held class instance.
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 25
static
$this
create(
string|null $class = null)
at line line 32
__construct(
ReflectionClass $reflectionClass = null)
Optional injection at instantiation of reflection class for analysis.
at line line 43
$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. Passing no value effectively un-sets the internally held class instance.
at line line 52
$this
setReflectionClassFromClassName(
string $class)
Create and set the reflection class via a class name.
at line line 61
$this
setReflectionClassFromClassInstance(
object $class)
Create and set the reflection class via a class instance.
at line line 66
null|ReflectionClass
getReflectionClass()
at line line 73
$this
unsetReflectionClass()
Un-sets the current reflection class associated with object.
at line line 83
$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 90
bool
getRequireFQN()
Returns whether the FQN is required or not.
at line line 101
bool
hasTrait(
string $traitName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Return true if the given object has the provided trait.
at line line 111
bool
hasMethod(
string $methodName,
ReflectionClass $class = null)
Returns true if the given object has the given method.
at line line 122
bool
hasProperty(
string $propertyName,
ReflectionClass $class = null,
bool $recursiveSearch = true)
Returns true if the given object has the given property.
at line line 129
array
getProperties(
int|bool $filter = \ReflectionProperty::IS_PUBLIC)
at line line 136
array
getPropertiesPublic()
Get an array of the class's public properties.
at line line 143
array
getPropertiesProtected()
Get an array of the class's protected properties.
at line line 150
array
getPropertiesPrivate()
Get an array of the class's private properties.
at line line 160
ReflectionProperty.
setPropertyPublic(
string $property,
ReflectionClass $class = null)
Set a protected/private property as public.
at line line 170
ReflectionMethod.
setMethodPublic(
string $method,
ReflectionClass $class = null)
Set a protected/private method as public.