class NikicParameterNode implements ParameterNode (View source)

Adapter for nikic/php-parser Param nodes.

Methods

__construct(Param $param)

No description

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.

Details

__construct(Param $param)

No description

Parameters

Param $param

string getName()

Get the parameter name.

Return Value

string

TypeNode|null getType()

Get the parameter type hint from signature.

Return Value

TypeNode|null

array getAttributes()

Get the parameter attributes (PHP 8.0+).

Return Value

array

bool isVariadic()

Check if the parameter is variadic (uses ... operator).

Return Value

bool

True if parameter is variadic, false otherwise

bool hasDefaultValue()

Check if the parameter has a default value in the signature.

Return Value

bool

True if the parameter has an explicit default value

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.

Return Value

mixed

The evaluated PHP default value

Exceptions

RuntimeException