Documentation

ArgumentMetadata
in package

Responsible for storing metadata of an argument.

Tags
author

Iltar van der Berg kjarli@gmail.com

Table of Contents

Constants

IS_INSTANCEOF  = 2

Properties

$attributes  : array<string|int, mixed>
$defaultValue  : mixed
$hasDefaultValue  : bool
$isNullable  : bool
$isVariadic  : bool
$name  : string
$type  : string|null

Methods

__construct()  : mixed
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> = []

getAttributes()

public getAttributes([string $name = null ][, int $flags = 0 ]) : array<string|int, object>
Parameters
$name : string = null
$flags : int = 0
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()

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

        
On this page

Search results