mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2025-01-21 21:01:15 +01:00
Move constants into NodeTraverser class
Not that the interface makes much sense anyway, but these are implementation details of a specific traverser.
This commit is contained in:
parent
f99a96e0a2
commit
a46b309975
@ -4,6 +4,24 @@ namespace PhpParser;
|
||||
|
||||
class NodeTraverser implements NodeTraverserInterface
|
||||
{
|
||||
/**
|
||||
* If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes
|
||||
* of the current node will not be traversed for any visitors.
|
||||
*
|
||||
* For subsequent visitors enterNode() will still be called on the current
|
||||
* node and leaveNode() will also be invoked for the current node.
|
||||
*/
|
||||
const DONT_TRAVERSE_CHILDREN = 1;
|
||||
|
||||
/**
|
||||
* If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs
|
||||
* in an array, it will be removed from the array.
|
||||
*
|
||||
* For subsequent visitors leaveNode() will still be invoked for the
|
||||
* removed node.
|
||||
*/
|
||||
const REMOVE_NODE = false;
|
||||
|
||||
/** @var NodeVisitor[] Visitors */
|
||||
protected $visitors;
|
||||
|
||||
|
@ -4,24 +4,6 @@ namespace PhpParser;
|
||||
|
||||
interface NodeTraverserInterface
|
||||
{
|
||||
/**
|
||||
* If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes
|
||||
* of the current node will not be traversed for any visitors.
|
||||
*
|
||||
* For subsequent visitors enterNode() will still be called on the current
|
||||
* node and leaveNode() will also be invoked for the current node.
|
||||
*/
|
||||
const DONT_TRAVERSE_CHILDREN = 1;
|
||||
|
||||
/**
|
||||
* If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs
|
||||
* in an array, it will be removed from the array.
|
||||
*
|
||||
* For subsequent visitors leaveNode() will still be invoked for the
|
||||
* removed node.
|
||||
*/
|
||||
const REMOVE_NODE = false;
|
||||
|
||||
/**
|
||||
* Adds a visitor.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user