interface ClassReflectionAnalyserInterface

Interface ClassReflectionAnalyserInterface.

Methods

static  $this
create( string|null $class = null)

No description

__construct( ReflectionClass $reflectionClass = null)

Optional injection at instantiation of reflection class for analysis.

$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.

$this
setReflectionClassFromClassName( string $class)

Create and set the reflection class via a class name.

$this
setReflectionClassFromClassInstance( object $class)

Create and set the reflection class via a class instance.

getReflectionClass()

No description

$this
unsetReflectionClass()

Un-sets the current reflection class associated with object.

$this
setRequireFQN( bool $requireFQN = true)

Enables ability to allow unsafe checks against trait names without passing a fully-qualified namespace.

bool
getRequireFQN()

Returns whether the FQN is required or not.

bool
hasTrait( string $traitName, ReflectionClass $class = null, bool $recursiveSearch = true)

Return true if the given object has the provided trait.

bool
hasMethod( string $methodName, ReflectionClass $class = null)

Returns true if the given object has the given method.

bool
hasProperty( string $propertyName, ReflectionClass $class = null, bool $recursiveSearch = true)

Returns true if the given object has the given property.

array
getProperties( int|bool $filter = \ReflectionProperty::IS_PUBLIC)

No description

array
getPropertiesPublic()

Get an array of the class's public properties.

array
getPropertiesProtected()

Get an array of the class's protected properties.

array
getPropertiesPrivate()

Get an array of the class's private properties.

ReflectionProperty.
setPropertyPublic( string $property, ReflectionClass $class = null)

Set a protected/private property as public.

ReflectionMethod.
setMethodPublic( string $method, ReflectionClass $class = null)

Set a protected/private method as public.

Details

at line line 25
static $this create( string|null $class = null)

Parameters

string|null $class

Return Value

$this

at line line 32
__construct( ReflectionClass $reflectionClass = null)

Optional injection at instantiation of reflection class for analysis.

Parameters

ReflectionClass $reflectionClass

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.

Parameters

ReflectionClass $reflectionClass

Return Value

$this

at line line 52
$this setReflectionClassFromClassName( string $class)

Create and set the reflection class via a class name.

Parameters

string $class

Return Value

$this

at line line 61
$this setReflectionClassFromClassInstance( object $class)

Create and set the reflection class via a class instance.

Parameters

object $class

Return Value

$this

at line line 66
null|ReflectionClass getReflectionClass()

Return Value

null|ReflectionClass

at line line 73
$this unsetReflectionClass()

Un-sets the current reflection class associated with object.

Return Value

$this

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...

Parameters

bool $requireFQN

Return Value

$this

at line line 90
bool getRequireFQN()

Returns whether the FQN is required or not.

Return Value

bool

at line line 101
bool hasTrait( string $traitName, ReflectionClass $class = null, bool $recursiveSearch = true)

Return true if the given object has the provided trait.

Parameters

string $traitName
ReflectionClass $class
bool $recursiveSearch

Return Value

bool

at line line 111
bool hasMethod( string $methodName, ReflectionClass $class = null)

Returns true if the given object has the given method.

Parameters

string $methodName
ReflectionClass $class

Return Value

bool

at line line 122
bool hasProperty( string $propertyName, ReflectionClass $class = null, bool $recursiveSearch = true)

Returns true if the given object has the given property.

Parameters

string $propertyName
ReflectionClass $class
bool $recursiveSearch

Return Value

bool

at line line 129
array getProperties( int|bool $filter = \ReflectionProperty::IS_PUBLIC)

Parameters

int|bool $filter

Return Value

array

at line line 136
array getPropertiesPublic()

Get an array of the class's public properties.

Return Value

array

at line line 143
array getPropertiesProtected()

Get an array of the class's protected properties.

Return Value

array

at line line 150
array getPropertiesPrivate()

Get an array of the class's private properties.

Return Value

array

at line line 160
ReflectionProperty. setPropertyPublic( string $property, ReflectionClass $class = null)

Set a protected/private property as public.

Parameters

string $property
ReflectionClass $class

Return Value

ReflectionProperty.

at line line 170
ReflectionMethod. setMethodPublic( string $method, ReflectionClass $class = null)

Set a protected/private method as public.

Parameters

string $method
ReflectionClass $class

Return Value

ReflectionMethod.