ParameterNode
interface ParameterNode (View source)
Parser-agnostic interface for parameter AST nodes.
Methods
Get the parameter name.
Get the parameter attributes (PHP 8.0+).
Check if the parameter is variadic (uses ... operator).
Check if the parameter has a default value in the signature.
Evaluate and return the default value of the parameter.
Details
string
getName()
Get the parameter name.
TypeNode|null
getType()
Get the parameter type hint from signature.
array
getAttributes()
Get the parameter attributes (PHP 8.0+).
bool
isVariadic()
Check if the parameter is variadic (uses ... operator).
bool
hasDefaultValue()
Check if the parameter has a default value in the signature.
mixed
getDefaultValue()
Evaluate and return the default value of the parameter.
Implementations should evaluate the default expression to a PHP value, resolving named constants (e.g. SORT_REGULAR) via PHP's runtime.