class MethodReflection extends ReflectionMethod (View source)

Extended version of the ReflectionMethod

Properties

protected DocCommentParser $docCommentParser

Methods

getDeclaringClass()

Returns the declaring class

getParameters()

Replacement for the original getParameters() method which makes sure that ParameterReflection objects are returned instead of the original ReflectionParameter instances.

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

string|null
getDeclaredReturnType()

No description

bool
isDeclaredReturnTypeNullable()

No description

getDocCommentParser()

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

Details

ClassReflection getDeclaringClass()

Returns the declaring class

Return Value

ClassReflection

The declaring class

ParameterReflection[] getParameters()

Replacement for the original getParameters() method which makes sure that ParameterReflection objects are returned instead of the original ReflectionParameter instances.

Return Value

ParameterReflection[]

objects of the parameters of this method

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

Tag name to check for

Return Value

array

Values of the given tag

string getDescription()

Returns the description part of the doc comment

Return Value

string

Doc comment description

string|null getDeclaredReturnType()

No description

Return Value

string|null

The name of a type (e.g. string, \stdClass) if it was declared as a return type, null otherwise

bool isDeclaredReturnTypeNullable()

No description

Return Value

bool

Whether a return type is declared (getDeclaredReturnType()) and has a nullable modifier ("?")

protected DocCommentParser getDocCommentParser()

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

Return Value

DocCommentParser