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 FunctionDeclarationNode

A function declaration.

Pharborist\Node implements Pharborist\NodeInterface
Extended by Pharborist\ParentNode implements Pharborist\ParentNodeInterface
Extended by Pharborist\StatementNode
Extended by Pharborist\Functions\FunctionDeclarationNode uses Pharborist\Namespaces\IdentifierNameTrait, Pharborist\Functions\FunctionTrait
Namespace: Pharborist\Functions
Located at Functions/FunctionDeclarationNode.php
Methods summary
public static Pharborist\Functions\FunctionDeclarationNode
# create( Pharborist\Namespaces\NameNode|string $function_name, array $parameters = NULL )

Create a function declaration.

Create a function declaration.

Parameters

$function_name
The function name.
$parameters
(Optional) List of parameters.

Returns

Pharborist\Functions\FunctionDeclarationNode
public
# setName( string $name )

Set the name of the declared function.

Set the name of the declared function.

Parameters

$name
New function name.

Returns


$this
public Pharborist\StatementBlockNode
# getBody( )

Returns

Pharborist\StatementBlockNode
public Pharborist\Objects\ClassMethodNode
# cloneAsMethodOf( Pharborist\Objects\ClassNode $class )

Creates a class method from this function and add it to the given class definition.

Creates a class method from this function and add it to the given class definition.

Parameters

$class
The class to add the new method to.

Returns

Pharborist\Objects\ClassMethodNode
The newly created method.
Methods inherited from Pharborist\StatementNode
addCommentAbove(), getLineCount(), toComment()
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()
Methods used from Pharborist\Namespaces\IdentifierNameTrait
getName(), getNamespace(), inNamespace()
Methods used from Pharborist\Functions\FunctionTrait
getReference(), setReference()
Methods used from Pharborist\Functions\ParameterTrait
appendParameter(), clearParameters(), getOptionalParameters(), getParameter(), getParameterAtIndex(), getParameterByName(), getParameterList(), getParameterNames(), getParameters(), getRequiredParameters(), hasOptionalParameter(), hasParameter(), hasRequiredParameter(), hasRequiredParameters(), insertParameter(), isVariadic(), prependParameter()
Methods used from Pharborist\DocCommentTrait
getDocComment(), getIndent(), setDocComment()
Methods used from Pharborist\ParenTrait
getCloseParen(), getOpenParen()
Pharborist API documentation generated by ApiGen