1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-02 09:17:58 +01:00

Remove NodeTraverser dependency on parent::__construct() (#528)

A parent::__construct() call is now optional when extending NodeTraverser.
This commit is contained in:
Tomáš Votruba 2018-08-28 00:49:42 +02:00 committed by Nikita Popov
parent 1973b6633a
commit d7d581c1d2

View File

@ -31,16 +31,13 @@ class NodeTraverser implements NodeTraverserInterface
const REMOVE_NODE = 3; const REMOVE_NODE = 3;
/** @var NodeVisitor[] Visitors */ /** @var NodeVisitor[] Visitors */
protected $visitors; protected $visitors = [];
/** @var bool Whether traversal should be stopped */ /** @var bool Whether traversal should be stopped */
protected $stopTraversal; protected $stopTraversal;
/**
* Constructs a node traverser.
*/
public function __construct() { public function __construct() {
$this->visitors = []; // for BC
} }
/** /**