ReflectionService
in
Very simple reflection service abstraction.
This is required inside metadata layers that may require either static or runtime reflection.
Table of Contents
Methods
- getAccessibleProperty() : ReflectionProperty|null
- Returns an accessible property (setAccessible(true)) or null.
- getClass() : ReflectionClass|null
- Returns a reflection class instance or null.
- getClassNamespace() : string
- getClassShortName() : string
- Returns the shortname of a class.
- getParentClasses() : array<string|int, string>
- Returns an array of the parent classes (not interfaces) for the given class.
- hasPublicMethod() : bool
- Checks if the class have a public method with the given name.
Methods
getAccessibleProperty()
Returns an accessible property (setAccessible(true)) or null.
public
getAccessibleProperty(string $class, string $property) : ReflectionProperty|null
Parameters
- $class : string
- $property : string
Tags
Return values
ReflectionProperty|nullgetClass()
Returns a reflection class instance or null.
public
getClass(string $class) : ReflectionClass|null
Parameters
- $class : string
Tags
Return values
ReflectionClass|nullgetClassNamespace()
public
getClassNamespace(string $class) : string
Parameters
- $class : string
Tags
Return values
stringgetClassShortName()
Returns the shortname of a class.
public
getClassShortName(string $class) : string
Parameters
- $class : string
Tags
Return values
stringgetParentClasses()
Returns an array of the parent classes (not interfaces) for the given class.
public
getParentClasses(string $class) : array<string|int, string>
Parameters
- $class : string
Tags
Return values
array<string|int, string>hasPublicMethod()
Checks if the class have a public method with the given name.
public
hasPublicMethod(string $class, string $method) : bool
Parameters
- $class : string
- $method : string