ArgumentMetadata
in package
Responsible for storing metadata of an argument.
Tags
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
IS_INSTANCEOF
public
mixed
IS_INSTANCEOF
= 2
Properties
$attributes
private
array<string|int, mixed>
$attributes
$defaultValue
private
mixed
$defaultValue
$hasDefaultValue
private
bool
$hasDefaultValue
$isNullable
private
bool
$isNullable
$isVariadic
private
bool
$isVariadic
$name
private
string
$name
$type
private
string|null
$type
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
getName()
Returns the name as given in PHP, $foo would yield "foo".
public
getName() : string
Return values
stringgetType()
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|nullhasDefaultValue()
Returns whether the argument has a default value.
public
hasDefaultValue() : bool
Implies whether an argument is optional.
Return values
boolisNullable()
Returns whether the argument accepts null values.
public
isNullable() : bool
Return values
boolisVariadic()
Returns whether the argument is defined as "...$variadic".
public
isVariadic() : bool