Methods summary
public
Pharborist\CommaListNode
|
|
public
Pharborist\Functions\ParameterNodeCollection
|
|
public
string[]
|
|
public
|
|
public
|
#
appendParameter( Pharborist\Functions\ParameterNode |callable $parameter )
Appends a parameter.
Parameters
- $parameter
Either an existing parameter node, or a callable which will return
the parameter to append. The callable will receive $this as its
only argument.
Returns
$this
Throws
InvalidArgumentException
|
public
|
|
public
|
|
public
Pharborist\Functions\ParameterNode
|
#
getParameter( mixed $key )
Gets a parameter by name or index.
Gets a parameter by name or index.
Parameters
- $key
The parameter's name (without leading $) or position in the
parameter list.
Returns
Throws
InvalidArgumentException if the key is not a string or integer.
|
public
Pharborist\Functions\ParameterNode
|
#
getParameterAtIndex( integer $index )
Gets a parameter by its position in the parameter list.
Gets a parameter by its position in the parameter list.
Parameters
Returns
|
public
Pharborist\Functions\ParameterNode
|
#
getParameterByName( string $name )
Gets a parameter by its name.
Gets a parameter by its name.
Parameters
- $name
- The parameter name with or without leading $.
Returns
Throws
UnexpectedValueException if the named parameter doesn't exist.
|
public
boolean
|
#
hasParameter( mixed $parameter, string $type = NULL )
Checks if the function/method has a certain parameter.
Checks if the function/method has a certain parameter.
Parameters
- $parameter
- Either the parameter name (with or without the $), or a ParameterNode.
- $type
- Optional type hint to check as well.
Returns
boolean
Throws
InvalidArgumentException if $parameter is neither a string or
a ParameterNode.
|
public
boolean
|
#
hasRequiredParameter( mixed $parameter, string $type = NULL )
Checks if the function/method has a specific required parameter.
Checks if the function/method has a specific required parameter.
Parameters
- $parameter
Either the name of the parameter (with or without leading $), or a
ParameterNode.
- $type
- Optional type hint to check.
Returns
boolean
|
public
boolean
|
#
hasOptionalParameter( mixed $parameter, string $type = NULL )
Checks if the function/method has a specific optional parameter.
Checks if the function/method has a specific optional parameter.
Parameters
- $parameter
Either the name of the parameter (with or without leading $), or a
ParameterNode.
- $type
- Optional type hint to check.
Returns
boolean
|
public
boolean
|
|
public
Pharborist\NodeCollection
|
|
public
Pharborist\NodeCollection
|
|
public
boolean
|
#
isVariadic( )
Returns if the final parameter is variadic (PHP 5.6+), as in:
function foobaz($a, $b, ...$c)
Returns if the final parameter is variadic (PHP 5.6+), as in:
function foobaz($a, $b, ...$c)
Returns
boolean
|