mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-27 04:24:43 +01:00
Merge pull request #59 from Trismegiste/refactor-adding-an-interface-for-LSP
Adding an interface to the Node Traverser for LSP concern
This commit is contained in:
commit
c0da1b88b2
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class PHPParser_NodeTraverser
|
class PHPParser_NodeTraverser implements PHPParser_NodeTraverserInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var PHPParser_NodeVisitor[] Visitors
|
* @var PHPParser_NodeVisitor[] Visitors
|
||||||
|
22
lib/PHPParser/NodeTraverserInterface.php
Normal file
22
lib/PHPParser/NodeTraverserInterface.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
interface PHPParser_NodeTraverserInterface
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a visitor.
|
||||||
|
*
|
||||||
|
* @param PHPParser_NodeVisitor $visitor Visitor to add
|
||||||
|
*/
|
||||||
|
function addVisitor(PHPParser_NodeVisitor $visitor);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Traverses an array of nodes using the registered visitors.
|
||||||
|
*
|
||||||
|
* @param PHPParser_Node[] $nodes Array of nodes
|
||||||
|
*
|
||||||
|
* @return PHPParser_Node[] Traversed array of nodes
|
||||||
|
*/
|
||||||
|
function traverse(array $nodes);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user