Documentation

ArgumentMetadata
in package

Responsible for storing metadata of an argument.

Tags
author

Iltar van der Berg kjarli@gmail.com

Table of Contents

IS_INSTANCEOF  = 2
$attributes  : mixed
$defaultValue  : mixed
$hasDefaultValue  : mixed
$isNullable  : mixed
$isVariadic  : mixed
$name  : mixed
$type  : mixed
__construct()  : mixed
getAttribute()  : ArgumentInterface|null
Returns the attribute (if any) that was set on the argument.
getAttributes()  : array<string|int, object>
getDefaultValue()  : mixed
Returns the default value of the argument.
getName()  : string
Returns the name as given in PHP, $foo would yield "foo".
getType()  : string|null
Returns the type of the argument.
hasDefaultValue()  : bool
Returns whether the argument has a default value.
isNullable()  : bool
Returns whether the argument accepts null values.
isVariadic()  : bool
Returns whether the argument is defined as "...$variadic".

Constants

Properties

Methods

__construct()

public __construct(string $name, string|null $type, bool $isVariadic, bool $hasDefaultValue, mixed $defaultValue[, bool $isNullable = false ][, array<string|int, object> $attributes = [] ]) : mixed
Parameters
$name : string
$type : string|null
$isVariadic : bool
$hasDefaultValue : bool
$defaultValue : mixed
$isNullable : bool = false
$attributes : array<string|int, object> = []
Return values
mixed

getAttributes()

public getAttributes([string|null $name = null ], int $flags) : array<string|int, object>
Parameters
$name : string|null = null
$flags : int
Return values
array<string|int, object>

getDefaultValue()

Returns the default value of the argument.

public getDefaultValue() : mixed
Tags
throws
LogicException

if no default value is present; self::hasDefaultValue()

Return values
mixed

getName()

Returns the name as given in PHP, $foo would yield "foo".

public getName() : string
Return values
string

getType()

Returns the type of the argument.

public getType() : string|null

The type is the PHP class in 5.5+ and additionally the basic type in PHP 7.0+.

Return values
string|null

hasDefaultValue()

Returns whether the argument has a default value.

public hasDefaultValue() : bool

Implies whether an argument is optional.

Return values
bool

isNullable()

Returns whether the argument accepts null values.

public isNullable() : bool
Return values
bool

isVariadic()

Returns whether the argument is defined as "...$variadic".

public isVariadic() : bool
Return values
bool

Search results