ArgumentMetadata
in package
Responsible for storing metadata of an argument.
Tags
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
IS_INSTANCEOF
public
mixed
IS_INSTANCEOF
= 2
Properties
$attributes
private
mixed
$attributes
$defaultValue
private
mixed
$defaultValue
$hasDefaultValue
private
mixed
$hasDefaultValue
$isNullable
private
mixed
$isNullable
$isVariadic
private
mixed
$isVariadic
$name
private
mixed
$name
$type
private
mixed
$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> = []
Return values
mixed —getAttribute()
Returns the attribute (if any) that was set on the argument.
public
getAttribute() : ArgumentInterface|null
Return values
ArgumentInterface|null —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
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