From d7d581c1d2e01430cbae65e28b99aee3fe7c1cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Votruba?= Date: Tue, 28 Aug 2018 00:49:42 +0200 Subject: [PATCH] Remove NodeTraverser dependency on parent::__construct() (#528) A parent::__construct() call is now optional when extending NodeTraverser. --- lib/PhpParser/NodeTraverser.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/PhpParser/NodeTraverser.php b/lib/PhpParser/NodeTraverser.php index fe3045a..f9ef079 100644 --- a/lib/PhpParser/NodeTraverser.php +++ b/lib/PhpParser/NodeTraverser.php @@ -31,16 +31,13 @@ class NodeTraverser implements NodeTraverserInterface const REMOVE_NODE = 3; /** @var NodeVisitor[] Visitors */ - protected $visitors; + protected $visitors = []; /** @var bool Whether traversal should be stopped */ protected $stopTraversal; - /** - * Constructs a node traverser. - */ public function __construct() { - $this->visitors = []; + // for BC } /**