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:
Nikita Popov 2016-10-16 22:13:09 +02:00
parent f99a96e0a2
commit a46b309975
2 changed files with 18 additions and 18 deletions

View File

@ -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;

View File

@ -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.
*