Methods summary
public
Pharborist\SourcePosition
|
#
getSourcePosition( )
Get the source position of the node.
Get the source position of the node.
Returns
|
public
string
|
#
getText( )
Convert the node into PHP source code.
Convert the node into PHP source code.
Returns
string
|
public
Pharborist\ParentNode
|
#
parent( callable $callback = NULL )
Get the parent node.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
parents( callable $callback = NULL )
Get the ancestors of this node.
Get the ancestors of this node.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
parentsUntil( callable $callback, boolean $inclusive = FALSE )
Get ancestors up to the node matched by callback.
Get ancestors up to the node matched by callback.
Parameters
- $callback
- Callback to test for match.
- $inclusive
- TRUE to include the node matched by callback.
Returns
|
public
Pharborist\Node
|
#
closest( callable $callback )
Get the first node matched by the callback by testing this node and
traversing up through its ancestors in the tree.
Get the first node matched by the callback by testing this node and
traversing up through its ancestors in the tree.
Parameters
- $callback
- Callback to test for match.
Returns
|
public
Pharborist\Node
|
#
furthest( callable $callback )
Get the last node matched by the callback by testing this node and
traversing up through its ancestors in the tree.
Get the last node matched by the callback by testing this node and
traversing up through its ancestors in the tree.
Parameters
- $callback
- Callback to test for match.
Returns
|
public
integer
|
#
index( )
Get the position of the element relative to its sibling elements.
Get the position of the element relative to its sibling elements.
Returns
integer
|
public
Pharborist\Node
|
#
previous( callable $callback = NULL )
Get the previous sibling.
Get the previous sibling.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
previousAll( callable $callback = NULL )
Get the previous siblings of this node.
Get the previous siblings of this node.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
previousUntil( callable $callback, boolean $inclusive = FALSE )
Get all the preceding siblings up to but not including the match.
Get all the preceding siblings up to but not including the match.
Parameters
- $callback
- Callback to test for match.
- $inclusive
- TRUE to include the node matched by callback.
Returns
|
public
Pharborist\Node
|
#
next( callable $callback = NULL )
Get the next immediate sibling.
Get the next immediate sibling.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
nextAll( callable $callback = NULL )
Get all the following siblings.
Get all the following siblings.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
Pharborist\NodeCollection
|
#
nextUntil( callable $callback, boolean $inclusive = FALSE )
Get all the following siblings up to but not including the match.
Get all the following siblings up to but not including the match.
Parameters
- $callback
- Callback to test for match.
- $inclusive
- TRUE to include the node matched by callback.
Returns
|
public
Pharborist\NodeCollection
|
#
siblings( callable $callback = NULL )
Get the siblings.
Parameters
- $callback
- An optional callback to filter by.
Returns
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
remove( )
Remove this node from its parent.
Remove this node from its parent.
Returns
$this
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
Pharborist\RootNode |null
|
#
getRoot( )
Returns the root node if this node belongs to one.
Returns the root node if this node belongs to one.
Returns
|
public
|
#
hasRoot( )
Returns TRUE if this node belongs to a root node.
Returns TRUE if this node belongs to a root node.
|