Overview

Namespaces

  • Pharborist
    • Constants
    • ControlStructures
    • Exceptions
    • Functions
    • Generators
    • Namespaces
    • Objects
    • Operators
    • Types
    • Variables

Classes

  • AnonymousFunctionNode
  • CallbackCallNode
  • CallNode
  • DefineNode
  • EmptyNode
  • EvalNode
  • FunctionCallNode
  • FunctionDeclarationNode
  • HaltCompilerNode
  • IssetNode
  • ListNode
  • ParameterNode
  • ParameterNodeCollection
  • UnsetNode

Interfaces

  • LexicalVariableNode

Traits

  • ArgumentTrait
  • FunctionTrait
  • ParameterTrait
  • Overview
  • Namespace
  • Class

Class ParameterNode

A function parameter.

Pharborist\Node implements Pharborist\NodeInterface
Extended by Pharborist\ParentNode implements Pharborist\ParentNodeInterface
Extended by Pharborist\Functions\ParameterNode
Namespace: Pharborist\Functions
Located at Functions/ParameterNode.php
Methods summary
public static Pharborist\Functions\ParameterNode
# create( string $parameter_name )

Create a parameter node.

Create a parameter node.

Parameters

$parameter_name
Parameter name, eg. $parm

Returns

Pharborist\Functions\ParameterNode
public Pharborist\Functions\FunctionDeclarationNode|Pharborist\Objects\ClassMethodNode|Pharborist\Objects\InterfaceMethodNode|Pharborist\Functions\AnonymousFunctionNode|null
# getFunction( )

Returns the function/method which defines this parameter.

Returns the function/method which defines this parameter.

Returns

Pharborist\Functions\FunctionDeclarationNode|Pharborist\Objects\ClassMethodNode|Pharborist\Objects\InterfaceMethodNode|Pharborist\Functions\AnonymousFunctionNode|null
public Pharborist\Namespaces\NameNode|Pharborist\TokenNode
# getTypeHint( )

Returns

Pharborist\Namespaces\NameNode|Pharborist\TokenNode
public
# setTypeHint( string|Pharborist\Namespaces\NameNode|Pharborist\TokenNode $type_hint )

Parameters

$type_hint

Returns


$this
public Pharborist\TokenNode
# getReference( )

Returns

Pharborist\TokenNode
public
# setReference( boolean $is_reference )

Parameters

$is_reference

Returns


$this
public Pharborist\TokenNode
# getVariadic( )

Returns

Pharborist\TokenNode
public
# setVariadic( boolean $is_variadic )

Parameters

$is_variadic

Returns


$this
public boolean
# isVariadic( )

Returns

boolean
TRUE if parameter is variadic.
public boolean
# isOptional( )

Returns

boolean
public boolean
# isRequired( )

Returns

boolean
public Pharborist\Variables\VariableNode
# getVariable( )

Returns

Pharborist\Variables\VariableNode
public string
# getName( )

Returns

string
The parameter name, without the leading $.
public
# setName( string $name, boolean $rewrite = FALSE )

Parameters

$name
The name of the parameter, with or without the leading $.
$rewrite

If TRUE, every reference to the parameter in the function body will be changed to reflect the new name.

Returns


$this
public Pharborist\ExpressionNode
# getValue( )

Returns

Pharborist\ExpressionNode
public
# setValue( Pharborist\ExpressionNode|null $node )

Parameters

$node

Returns


$this
public null|phpDocumentor\Reflection\DocBlock\Tag\ParamTag
# getDocBlockTag( )

Get the doc block tag associated with this parameter.

Get the doc block tag associated with this parameter.

Returns

null|phpDocumentor\Reflection\DocBlock\Tag\ParamTag
The parameter tag or null if not found.
Methods inherited from Pharborist\ParentNode
__clone(), __toString(), acceptVisitor(), addChild(), addChildren(), append(), childCount(), children(), clear(), find(), firstChild(), firstToken(), getSourcePosition(), getText(), getTree(), has(), isDescendant(), isEmpty(), lastChild(), lastToken(), mergeNode(), prepend(), walk()
Methods inherited from Pharborist\Node
after(), appendTo(), before(), closest(), fromValue(), furthest(), getLogicalBlock(), getRoot(), getStatement(), hasRoot(), index(), insertAfter(), insertBefore(), is(), isAllOf(), isAnyOf(), next(), nextAll(), nextToken(), nextUntil(), parent(), parents(), parentsUntil(), prependTo(), previous(), previousAll(), previousToken(), previousUntil(), remove(), replaceAll(), replaceWith(), siblings(), sortKey(), swapWith()
Pharborist API documentation generated by ApiGen