Method
extends BaseTag
in package
implements
StaticMethod
FinalYes
Reflection class for an {@}method in a Docblock.
Table of Contents
Interfaces
Properties
- $description : Description|null
- $name : string
- $isStatic : bool
- $methodName : string
- $parameters : array<string|int, MethodParameter>
- $returnsReference : bool
- $returnType : Type
Methods
- __construct() : mixed
- __toString() : string
- create() : Tag|mixed
- getArguments() : array<int, array<string, Type|string>>
- getDescription() : Description|null
- getMethodName() : string
- Retrieves the method name.
- getName() : string
- Gets the name of this tag.
- getParameters() : array<string|int, MethodParameter>
- getReturnType() : Type
- isStatic() : bool
- Checks whether the method tag describes a static method or not.
- render() : string
- returnsReference() : bool
- filterArguments() : array<string|int, array<string|int, mixed>>
- fromLegacyArguments() : array<string|int, MethodParameter>
- stripRestArg() : string
Properties
$description
protected
Description|null
$description
= null
Description of the tag.
$name
protected
string
$name
= 'method'
Name of the tag
$isStatic
private
bool
$isStatic
$methodName
private
string
$methodName
$parameters
private
array<string|int, MethodParameter>
$parameters
$returnsReference
private
bool
$returnsReference
$returnType
private
Type
$returnType
Methods
__construct()
public
__construct(string $methodName[, array<int, array<string, Type|string>> $arguments = [] ][, Type|null $returnType = null ][, bool $static = false ][, Description|null $description = null ][, bool $returnsReference = false ][, array<string|int, MethodParameter> $parameters = null ]) : mixed
Parameters
- $methodName : string
- $arguments : array<int, array<string, Type|string>> = []
- $returnType : Type|null = null
- $static : bool = false
- $description : Description|null = null
- $returnsReference : bool = false
- $parameters : array<string|int, MethodParameter> = null
Tags
__toString()
public
__toString() : string
Return values
stringcreate()
public
static create(string $body[, TypeResolver|null $typeResolver = null ][, DescriptionFactory|null $descriptionFactory = null ][, Context|null $context = null ]) : Tag|mixed
Create using static factory is deprecated, this method should not be called directly by library consumers
Parameters
- $body : string
- $typeResolver : TypeResolver|null = null
- $descriptionFactory : DescriptionFactory|null = null
- $context : Context|null = null
Return values
Tag|mixed —Class that implements Tag
getArguments()
public
getArguments() : array<int, array<string, Type|string>>
Method deprecated, use self::getParameters()
Tags
Return values
array<int, array<string, Type|string>>getDescription()
public
getDescription() : Description|null
Return values
Description|nullgetMethodName()
Retrieves the method name.
public
getMethodName() : string
Return values
stringgetName()
Gets the name of this tag.
public
getName() : string
Return values
string —The name of this tag.
getParameters()
public
getParameters() : array<string|int, MethodParameter>
Return values
array<string|int, MethodParameter>getReturnType()
public
getReturnType() : Type
Return values
TypeisStatic()
Checks whether the method tag describes a static method or not.
public
isStatic() : bool
Return values
bool —TRUE if the method declaration is for a static method, FALSE otherwise.
render()
public
render([Formatter|null $formatter = null ]) : string
Parameters
- $formatter : Formatter|null = null
Return values
stringreturnsReference()
public
returnsReference() : bool
Return values
boolfilterArguments()
private
filterArguments([array<string|int, array<string|int, mixed>>|array<string|int, string> $arguments = [] ]) : array<string|int, array<string|int, mixed>>
Parameters
- $arguments : array<string|int, array<string|int, mixed>>|array<string|int, string> = []
Tags
Return values
array<string|int, array<string|int, mixed>>fromLegacyArguments()
private
fromLegacyArguments(Type} $arguments) : array<string|int, MethodParameter>
Parameters
- $arguments : Type}
Tags
Return values
array<string|int, MethodParameter>stripRestArg()
private
static stripRestArg(string $argument) : string
Parameters
- $argument : string