class ClassReflection extends ReflectionClass (View source)

Extended version of the ReflectionClass

Properties

protected DocCommentParser $docCommentParser

Methods

__construct(mixed $classNameOrObject)

No description

getConstructor()

Replacement for the original getConstructor() method which makes sure that MethodReflection objects are returned instead of the original ReflectionMethod instances.

array
getInterfaces()

Replacement for the original getInterfaces() method which makes sure that ClassReflection objects are returned instead of the original ReflectionClass instances.

getMethod(string $name)

Replacement for the original getMethod() method which makes sure that MethodReflection objects are returned instead of the orginal ReflectionMethod instances.

array
getMethods(int|null $filter = null)

Replacement for the original getMethods() method which makes sure that MethodReflection objects are returned instead of the original ReflectionMethod instances.

ClassReflection|false
getParentClass()

Replacement for the original getParentClass() method which makes sure that a ClassReflection object is returned instead of the orginal ReflectionClass instance.

array
getProperties(int $filter = null)

Replacement for the original getProperties() method which makes sure that PropertyReflection objects are returned instead of the orginal ReflectionProperty instances.

getProperty(string $name)

Replacement for the original getProperty() method which makes sure that a PropertyReflection object is returned instead of the orginal ReflectionProperty instance.

bool
isTaggedWith(string $tag)

Checks if the doc comment of this method is tagged with the specified tag

array
getTagsValues()

Returns an array of tags and their values

array
getTagValues(string $tag)

Returns the values of the specified tag

string
getDescription()

Returns the description part of the doc comment

object
newInstanceWithoutConstructor()

Creates a new class instance without invoking the constructor.

getDocCommentParser()

Returns an instance of the doc comment parser and runs the parse() method.

Details

__construct(mixed $classNameOrObject)

No description

Parameters

mixed $classNameOrObject

the name of the class or the object to be reflected.

Exceptions

ClassLoadingForReflectionFailedException

MethodReflection getConstructor()

Replacement for the original getConstructor() method which makes sure that MethodReflection objects are returned instead of the original ReflectionMethod instances.

Return Value

MethodReflection

Method reflection object of the constructor method

array getInterfaces()

Replacement for the original getInterfaces() method which makes sure that ClassReflection objects are returned instead of the original ReflectionClass instances.

Return Value

array

Class reflection objects of the properties in this class

MethodReflection getMethod(string $name)

Replacement for the original getMethod() method which makes sure that MethodReflection objects are returned instead of the orginal ReflectionMethod instances.

Parameters

string $name

Return Value

MethodReflection

Method reflection object of the named method

array getMethods(int|null $filter = null)

Replacement for the original getMethods() method which makes sure that MethodReflection objects are returned instead of the original ReflectionMethod instances.

Parameters

int|null $filter

A filter mask

Return Value

array

Method reflection objects of the methods in this class

ClassReflection|false getParentClass()

Replacement for the original getParentClass() method which makes sure that a ClassReflection object is returned instead of the orginal ReflectionClass instance.

Return Value

ClassReflection|false

Reflection of the parent class - if any

array getProperties(int $filter = null)

Replacement for the original getProperties() method which makes sure that PropertyReflection objects are returned instead of the orginal ReflectionProperty instances.

Parameters

int $filter

A filter mask

Return Value

array

Property reflection objects of the properties in this class

PropertyReflection getProperty(string $name)

Replacement for the original getProperty() method which makes sure that a PropertyReflection object is returned instead of the orginal ReflectionProperty instance.

Parameters

string $name

Name of the property

Return Value

PropertyReflection

Property reflection object of the specified property in this class

bool isTaggedWith(string $tag)

Checks if the doc comment of this method is tagged with the specified tag

Parameters

string $tag

Tag name to check for

Return Value

bool

true if such a tag has been defined, otherwise false

array getTagsValues()

Returns an array of tags and their values

Return Value

array

Tags and values

array getTagValues(string $tag)

Returns the values of the specified tag

Parameters

string $tag

Return Value

array

Values of the given tag

string getDescription()

Returns the description part of the doc comment

Return Value

string

Doc comment description

object newInstanceWithoutConstructor()

Creates a new class instance without invoking the constructor.

Overridden to make sure DI works even when instances are created using newInstanceWithoutConstructor()

protected DocCommentParser getDocCommentParser()

Returns an instance of the doc comment parser and runs the parse() method.

Return Value

DocCommentParser