mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-01-17 07:08:14 +01:00
Document new DONT_TRAVERSER_CURRENT_AND_CHILDREN
constant (#540)
* Document new `DONT_TRAVERSER_CURRENT_AND_CHILDREN` constant * Rewording sentences, added 1 space indentation to make bullet list correct
This commit is contained in:
parent
d0230c5c77
commit
fb3d89e463
@ -339,7 +339,8 @@ All four methods can either return the changed node or not return at all (i.e. `
|
||||
case the current node is not changed.
|
||||
|
||||
The `enterNode()` method can additionally return the value `NodeTraverser::DONT_TRAVERSE_CHILDREN`,
|
||||
which instructs the traverser to skip all children of the current node.
|
||||
which instructs the traverser to skip all children of the current node. To furthermore prevent subsequent
|
||||
visitors from visiting the current node, `NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN` can be used instead.
|
||||
|
||||
The `leaveNode()` method can additionally return the value `NodeTraverser::REMOVE_NODE`, in which
|
||||
case the current node will be removed from the parent array. Furthermore it is possible to return
|
||||
|
@ -281,6 +281,8 @@ special enterNode/leaveNode return values:
|
||||
|
||||
* If *any* visitor returns `DONT_TRAVERSE_CHILDREN`, the children will be skipped for *all*
|
||||
visitors.
|
||||
* If *any* visitor returns `DONT_TRAVERSER_CURRENT_AND_CHILDREN`, the children will be skipped for *all*
|
||||
visitors, and all *subsequent* visitors will not visit the current node.
|
||||
* If *any* visitor returns `STOP_TRAVERSAL`, traversal is stopped for *all* visitors.
|
||||
* If a visitor returns a replacement node, subsequent visitors will be passed the replacement node,
|
||||
not the original one.
|
||||
|
Loading…
x
Reference in New Issue
Block a user