Documentation

Method extends BaseTag
in package
implements StaticMethod

Reflection class for an {@}method in a Docblock.

Interfaces, Classes and Traits

StaticMethod

Table of Contents

$description  : Description|null
$name  : string
$isStatic  : bool
$methodName  : string
$parameters  : array<string|int, mixed>
$returnsReference  : bool
$returnType  : Type
__construct()  : mixed
__toString()  : string
create()  : mixed
getArguments()  : array<int, array<string, \phpDocumentor\Reflection\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

$name

protected string $name = 'method'

Name of the tag

$isStatic

private bool $isStatic

$methodName

private string $methodName

$parameters

private array<string|int, mixed> $parameters

$returnsReference

private bool $returnsReference

Methods

__construct()

public __construct(string $methodName[, array<int, array<string, \phpDocumentor\Reflection\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, \phpDocumentor\Reflection\Type|string>> = []
$returnType : Type|null = null
$static : bool = false
$description : Description|null = null
$returnsReference : bool = false
$parameters : array<string|int, MethodParameter> = null
Tags
phpstan-param

array<int, array{name: string, type: Type}|string> $arguments

Return values
mixed

__toString()

public __toString() : string
Return values
string

create()

public static create(string $body[, TypeResolver|null $typeResolver = null ][, DescriptionFactory|null $descriptionFactory = null ][, Context|null $context = null ]) : mixed
Parameters
$body : string
$typeResolver : TypeResolver|null = null
$descriptionFactory : DescriptionFactory|null = null
$context : Context|null = null
Tags
deprecated

Create using static factory is deprecated, this method should not be called directly by library consumers

Return values
mixed

getArguments()

public getArguments() : array<int, array<string, \phpDocumentor\Reflection\Type|string>>
Tags
deprecated

Method deprecated, use self::getParameters()

phpstan-return

array<int, array{name: string, type: Type}>

Return values
array<int, array<string, \phpDocumentor\Reflection\Type|string>>

getMethodName()

Retrieves the method name.

public getMethodName() : string
Return values
string

getName()

Gets the name of this tag.

public getName() : string
Return values
string

The name of this tag.

isStatic()

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
string

returnsReference()

public returnsReference() : bool
Return values
bool

filterArguments()

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

array<int, array{name: string, type: Type}|string> $arguments

phpstan-return

array<int, array{name: string, type: Type}>

Return values
array<string|int, array<string|int, mixed>>

fromLegacyArguments()

private fromLegacyArguments(array{name: string, type: \phpDocumentor\Reflection\Type} $arguments) : array<string|int, MethodParameter>
Parameters
$arguments : array{name: string, type: \phpDocumentor\Reflection\Type}
Tags
phpstan-param

array<int, array{name: string, type: Type}> $arguments

Return values
array<string|int, MethodParameter>

stripRestArg()

private static stripRestArg(string $argument) : string
Parameters
$argument : string
Return values
string

Search results