ArgumentMetadataFactory
in package
implements
ArgumentMetadataFactoryInterface
Builds {@see ArgumentMetadata} objects based on the given Controller.
Tags
Interfaces, Classes and Traits
- ArgumentMetadataFactoryInterface
- Builds method argument data.
Table of Contents
- $supportsParameterType : bool
- If the reflection supports the getType() method to resolve types.
- $supportsVariadic : bool
- If the ...$arg functionality is available.
- __construct() : mixed
- createArgumentMetadata() : array<string|int, ArgumentMetadata>
- getDefaultValue() : mixed|null
- Returns a default value if available.
- getType() : string|null
- Returns an associated type to the given parameter if available.
- hasDefaultValue() : bool
- Determines whether an argument has a default value.
- isVariadic() : bool
- Returns whether an argument is variadic.
Properties
$supportsParameterType
If the reflection supports the getType() method to resolve types.
private
bool
$supportsParameterType
Requires at least PHP 7.0.0 or HHVM 3.11.0
$supportsVariadic
If the ...$arg functionality is available.
private
bool
$supportsVariadic
Requires at least PHP 5.6.0 or HHVM 3.9.1
Methods
__construct()
public
__construct() : mixed
Return values
mixed —createArgumentMetadata()
public
createArgumentMetadata(mixed $controller) : array<string|int, ArgumentMetadata>
Parameters
- $controller : mixed
-
The controller to resolve the arguments for
Return values
array<string|int, ArgumentMetadata> —getDefaultValue()
Returns a default value if available.
private
getDefaultValue(ReflectionParameter $parameter) : mixed|null
Parameters
- $parameter : ReflectionParameter
Return values
mixed|null —getType()
Returns an associated type to the given parameter if available.
private
getType(ReflectionParameter $parameter, ReflectionFunctionAbstract $function) : string|null
Parameters
- $parameter : ReflectionParameter
- $function : ReflectionFunctionAbstract
Return values
string|null —hasDefaultValue()
Determines whether an argument has a default value.
private
hasDefaultValue(ReflectionParameter $parameter) : bool
Parameters
- $parameter : ReflectionParameter
Return values
bool —isVariadic()
Returns whether an argument is variadic.
private
isVariadic(ReflectionParameter $parameter) : bool
Parameters
- $parameter : ReflectionParameter