Overview

Namespaces

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

Classes

  • ArrayLookupNode
  • BacktickNode
  • BlankStatementNode
  • CommaListNode
  • CommentNode
  • DocCommentNode
  • EchoStatementNode
  • EchoTagStatementNode
  • ExpressionStatementNode
  • Filter
  • Formatter
  • FormatterFactory
  • LineCommentBlockNode
  • Node
  • NodeCollection
  • OperatorFactory
  • ParenthesisNode
  • ParentNode
  • Parser
  • PartialCommentNode
  • PartialNode
  • RootNode
  • SourceDiscovery
  • SourcePosition
  • SplatNode
  • StatementBlockNode
  • StatementNode
  • TemplateNode
  • Token
  • TokenIterator
  • Tokenizer
  • TokenNode
  • UnsetStatementNode
  • VisitorBase
  • WhitespaceNode

Interfaces

  • ExpressionNode
  • NodeInterface
  • ParentNodeInterface
  • ParserException
  • VisitorInterface

Traits

  • DocCommentTrait
  • ParenTrait
  • UncommentTrait
  • Overview
  • Namespace
  • Class

Interface ParentNodeInterface

Public API for Node.

This interface is used by tagging interfaces such as ExpressionNode to indicate they support the Node API.

Pharborist\ParentNodeInterface implements Pharborist\NodeInterface

Direct known implementers

Pharborist\Objects\InterfaceStatementNode, Pharborist\ParentNode

Indirect known implementers

Pharborist\ArrayLookupNode, Pharborist\BacktickNode, Pharborist\ControlStructures\DeclareDirectiveNode, Pharborist\Operators\CloneNode, Pharborist\Operators\ConcatAssignNode, Pharborist\Operators\ConcatNode, Pharborist\Operators\DivideAssignNode, Pharborist\Operators\DivideNode, Pharborist\Operators\ElvisNode, Pharborist\Operators\EqualNode, Pharborist\Operators\FloatCastNode, Pharborist\Operators\GreaterThanNode, Pharborist\Operators\GreaterThanOrEqualToNode, Pharborist\ControlStructures\DeclareNode, Pharborist\Operators\IdenticalNode, Pharborist\Operators\InstanceOfNode, Pharborist\Operators\IntegerCastNode, Pharborist\Operators\LessThanNode, Pharborist\Operators\LessThanOrEqualToNode, Pharborist\Operators\LogicalAndNode, Pharborist\Operators\LogicalOrNode, Pharborist\Operators\LogicalXorNode, Pharborist\Operators\ModulusAssignNode, Pharborist\Operators\ModulusNode, Pharborist\ControlStructures\DefaultNode, Pharborist\Operators\MultiplyAssignNode, Pharborist\Operators\MultiplyNode, Pharborist\Operators\NegateNode, Pharborist\Operators\NotEqualNode, Pharborist\Operators\NotIdenticalNode, Pharborist\Operators\ObjectCastNode, Pharborist\Operators\PlusNode, Pharborist\Operators\PostDecrementNode, Pharborist\Operators\PostIncrementNode, Pharborist\Operators\PowerAssignNode, Pharborist\ControlStructures\DoWhileNode, Pharborist\Operators\PowerNode, Pharborist\Operators\PreDecrementNode, Pharborist\Operators\PreIncrementNode, Pharborist\Operators\PrintNode, Pharborist\Operators\StringCastNode, Pharborist\Operators\SubtractAssignNode, Pharborist\Operators\SubtractNode, Pharborist\Operators\SuppressWarningNode, Pharborist\Operators\TernaryOperationNode, Pharborist\Operators\UnaryOperationNode, Pharborist\ControlStructures\ElseIfNode, Pharborist\Operators\UnsetCastNode, Pharborist\ParenthesisNode, Pharborist\PartialCommentNode, Pharborist\PartialNode, Pharborist\RootNode, Pharborist\SplatNode, Pharborist\StatementBlockNode, Pharborist\StatementNode, Pharborist\TemplateNode, Pharborist\Types\ArrayNode, Pharborist\ControlStructures\ExitNode, Pharborist\Types\ArrayPairNode, Pharborist\Types\BooleanNode, Pharborist\Types\FalseNode, Pharborist\Types\HeredocNode, Pharborist\Types\InterpolatedStringNode, Pharborist\Types\NullNode, Pharborist\Types\StringVariableNode, Pharborist\Types\TrueNode, Pharborist\UnsetStatementNode, Pharborist\Variables\CompoundVariableNode, Pharborist\ControlStructures\ForeachNode, Pharborist\Variables\GlobalStatementNode, Pharborist\Variables\ReferenceVariableNode, Pharborist\Variables\StaticVariableNode, Pharborist\Variables\StaticVariableStatementNode, Pharborist\Variables\VariableVariableNode, Pharborist\ControlStructures\ForNode, Pharborist\ControlStructures\GotoLabelNode, Pharborist\ControlStructures\GotoStatementNode, Pharborist\BlankStatementNode, Pharborist\ControlStructures\IfNode, Pharborist\ControlStructures\ImportNode, Pharborist\ControlStructures\IncludeNode, Pharborist\ControlStructures\IncludeOnceNode, Pharborist\ControlStructures\RequireNode, Pharborist\ControlStructures\RequireOnceNode, Pharborist\ControlStructures\ReturnStatementNode, Pharborist\ControlStructures\SwitchNode, Pharborist\ControlStructures\WhileNode, Pharborist\EchoStatementNode, Pharborist\CommaListNode, Pharborist\EchoTagStatementNode, Pharborist\Exceptions\CatchNode, Pharborist\Exceptions\ThrowStatementNode, Pharborist\Exceptions\TryCatchNode, Pharborist\ExpressionStatementNode, Pharborist\Functions\AnonymousFunctionNode, Pharborist\Functions\CallbackCallNode, Pharborist\Functions\CallNode, Pharborist\Functions\DefineNode, Pharborist\Functions\EmptyNode, Pharborist\Constants\ConstantDeclarationNode, Pharborist\Functions\EvalNode, Pharborist\Functions\FunctionCallNode, Pharborist\Functions\FunctionDeclarationNode, Pharborist\Functions\HaltCompilerNode, Pharborist\Functions\IssetNode, Pharborist\Functions\ListNode, Pharborist\Functions\ParameterNode, Pharborist\Functions\UnsetNode, Pharborist\Generators\YieldNode, Pharborist\Generators\YieldStatementNode, Pharborist\Constants\ConstantDeclarationStatementNode, Pharborist\LineCommentBlockNode, Pharborist\Namespaces\NameNode, Pharborist\Namespaces\NamespaceNode, Pharborist\Namespaces\UseDeclarationBlockNode, Pharborist\Namespaces\UseDeclarationNode, Pharborist\Namespaces\UseDeclarationStatementNode, Pharborist\Objects\ClassConstantLookupNode, Pharborist\Objects\ClassMemberListNode, Pharborist\Objects\ClassMemberLookupNode, Pharborist\Objects\ClassMemberNode, Pharborist\Constants\ConstantNode, Pharborist\Objects\ClassMethodCallNode, Pharborist\Objects\ClassMethodNode, Pharborist\Objects\ClassNameScalarNode, Pharborist\Objects\ClassNode, Pharborist\Objects\ClassStatementNode, Pharborist\Objects\InterfaceMethodNode, Pharborist\Objects\InterfaceNode, Pharborist\Objects\NameExpressionNode, Pharborist\Objects\NewNode, Pharborist\Objects\ObjectMethodCallNode, Pharborist\ControlStructures\BreakStatementNode, Pharborist\Objects\ObjectPropertyNode, Pharborist\Objects\SingleInheritanceNode, Pharborist\Objects\TraitAdaptationStatementNode, Pharborist\Objects\TraitAliasNode, Pharborist\Objects\TraitMethodReferenceNode, Pharborist\Objects\TraitNode, Pharborist\Objects\TraitPrecedenceNode, Pharborist\Objects\TraitUseNode, Pharborist\Operators\AddAssignNode, Pharborist\Operators\AddNode, Pharborist\ControlStructures\CaseNode, Pharborist\Operators\ArrayCastNode, Pharborist\Operators\AssignNode, Pharborist\Operators\AssignReferenceNode, Pharborist\Operators\BinaryOperationNode, Pharborist\Operators\BitwiseAndAssignNode, Pharborist\Operators\BitwiseAndNode, Pharborist\Operators\BitwiseNotNode, Pharborist\Operators\BitwiseOrAssignNode, Pharborist\Operators\BitwiseOrNode, Pharborist\Operators\BitwiseShiftLeftAssignNode, Pharborist\ControlStructures\ContinueStatementNode, Pharborist\Operators\BitwiseShiftLeftNode, Pharborist\Operators\BitwiseShiftRightAssignNode, Pharborist\Operators\BitwiseShiftRightNode, Pharborist\Operators\BitwiseXorAssignNode, Pharborist\Operators\BitwiseXorNode, Pharborist\Operators\BooleanAndNode, Pharborist\Operators\BooleanCastNode, Pharborist\Operators\BooleanNotNode, Pharborist\Operators\BooleanOrNode, Pharborist\Operators\CastNode
Namespace: Pharborist
Located at ParentNodeInterface.php
Methods summary
public integer
# childCount( )

Get the number of children.

Get the number of children.

Returns

integer
public Pharborist\Node
# firstChild( )

Return the first child.

Return the first child.

Returns

Pharborist\Node
public Pharborist\Node
# lastChild( )

Return the last child.

Return the last child.

Returns

Pharborist\Node
public Pharborist\NodeCollection
# children( callable $callback = NULL )

Get the immediate children of this node.

Get the immediate children of this node.

Parameters

$callback
An optional callback to filter by.

Returns

Pharborist\NodeCollection
public
# clear( )

Remove all child nodes.

Remove all child nodes.

public
# prepend( Pharborist\Node|Pharborist\Node[]|Pharborist\NodeCollection $nodes )

Prepend nodes to this node.

Prepend nodes to this node.

Parameters

$nodes

Returns


$this

Throws

InvalidArgumentException
public
# append( Pharborist\Node|Pharborist\Node[]|Pharborist\NodeCollection $nodes )

Append nodes to this node.

Append nodes to this node.

Parameters

$nodes

Returns


$this

Throws

InvalidArgumentException
public Pharborist\TokenNode
# firstToken( )

Get the first (i.e. leftmost leaf) token.

Get the first (i.e. leftmost leaf) token.

Returns

Pharborist\TokenNode
public Pharborist\TokenNode
# lastToken( )

Get the last (i.e. rightmost leaf) token.

Get the last (i.e. rightmost leaf) token.

Returns

Pharborist\TokenNode
public Pharborist\NodeCollection
# has( callable $callback )

Test if the node has a descendant that matches.

Test if the node has a descendant that matches.

Parameters

$callback
Callback to test for match.

Returns

Pharborist\NodeCollection
public boolean
# isDescendant( Pharborist\Node $node )

Test if the node is a descendant of this node.

Test if the node is a descendant of this node.

Parameters

$node
Node to test

Returns

boolean
public Pharborist\NodeCollection
# find( callable $callback )

Find descendants that pass filter callback.

Find descendants that pass filter callback.

Parameters

$callback
Callback to filter by.

Returns

Pharborist\NodeCollection
public
# walk( callable $callback )

Perform callback on this node and all descendant nodes.

Perform callback on this node and all descendant nodes.

Parameters

$callback
Callback for each node.
Methods inherited from Pharborist\NodeInterface
after(), appendTo(), before(), closest(), furthest(), getRoot(), getSourcePosition(), getText(), hasRoot(), index(), insertAfter(), insertBefore(), next(), nextAll(), nextUntil(), parent(), parents(), parentsUntil(), prependTo(), previous(), previousAll(), previousUntil(), remove(), replaceAll(), replaceWith(), siblings(), swapWith()
Pharborist API documentation generated by ApiGen