Documentation

ReflectionService

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
psalm-param

class-string $class

Return values
ReflectionProperty|null

getClass()

Returns a reflection class instance or null.

public getClass(string $class) : ReflectionClass|null
Parameters
$class : string
Tags
psalm-param

class-string<T> $class

psalm-return

ReflectionClass<T>|null

template

T of object

Return values
ReflectionClass|null

getClassNamespace()

public getClassNamespace(string $class) : string
Parameters
$class : string
Tags
psalm-param

class-string $class

Return values
string

getClassShortName()

Returns the shortname of a class.

public getClassShortName(string $class) : string
Parameters
$class : string
Tags
psalm-param

class-string $class

Return values
string

getParentClasses()

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
psalm-param

class-string $class

psalm-return

class-string[]

throws
MappingException
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
Tags
psalm-param

class-string $class

Return values
bool

        
On this page

Search results