Documentation

Param extends TagWithType
in package
implements StaticMethod

Reflection class for the {@}param tag in a Docblock.

Interfaces, Classes and Traits

StaticMethod

Table of Contents

$description  : Description|null
$name  : string
$type  : Type|null
$isReference  : bool
$isVariadic  : bool
$variableName  : string|null
__construct()  : mixed
__toString()  : string
Returns a string representation for this tag.
create()  : mixed
getDescription()  : Description|null
getName()  : string
Gets the name of this tag.
getType()  : Type|null
Returns the type section of the variable.
getVariableName()  : string|null
Returns the variable's name.
isReference()  : bool
Returns whether this tag is passed by reference.
isVariadic()  : bool
Returns whether this tag is variadic.
render()  : string
extractTypeFromBody()  : array<string|int, string>
strStartsWithVariable()  : bool

Properties

$name

protected string $name = ''

Name of the tag

$isReference

private bool $isReference

determines whether this is passed by reference

$isVariadic

private bool $isVariadic

determines whether this is a variadic argument

$variableName

private string|null $variableName = null

Methods

__construct()

public __construct(string|null $variableName[, Type|null $type = null ][, bool $isVariadic = false ][, Description|null $description = null ][, bool $isReference = false ]) : mixed
Parameters
$variableName : string|null
$type : Type|null = null
$isVariadic : bool = false
$description : Description|null = null
$isReference : bool = false
Return values
mixed

__toString()

Returns a string representation for this tag.

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

getName()

Gets the name of this tag.

public getName() : string
Return values
string

The name of this tag.

getType()

Returns the type section of the variable.

public getType() : Type|null
Return values
Type|null

getVariableName()

Returns the variable's name.

public getVariableName() : string|null
Return values
string|null

isReference()

Returns whether this tag is passed by reference.

public isReference() : bool
Return values
bool

isVariadic()

Returns whether this tag is variadic.

public isVariadic() : bool
Return values
bool

render()

public render([Formatter|null $formatter = null ]) : string
Parameters
$formatter : Formatter|null = null
Return values
string

extractTypeFromBody()

protected static extractTypeFromBody(string $body) : array<string|int, string>
Parameters
$body : string
Return values
array<string|int, string>

strStartsWithVariable()

private static strStartsWithVariable(string $str) : bool
Parameters
$str : string
Return values
bool

Search results