Fix NamespaceNodeVisitor to catch UseNodes even without namespace

This commit is contained in:
Tomas Votruba 2018-09-27 23:57:03 +08:00
parent 4b4547d3cc
commit f7646048c6

View File

@ -44,7 +44,9 @@ final class NamespaceNodeVisitor extends NodeVisitorAbstract
{
$this->namespaceName = null;
$this->namespaceNode = null;
$this->useNodes = [];
// init basic use nodes for non-namespaced code
$this->useNodes = $this->betterNodeFinder->findInstanceOf($nodes, Use_::class);
return null;
}