public function leaveNode(Node $node)
    {
        if (!$node instanceof ClassLikeNode) {
            return null;
        }

        // not in class context
        if ($this->currentClass === null) {
            $this->tempDependencies = new DependencySet();
            return;
        }

        // by now the class should have been parsed so replace the
        // temporary class with the parsed class name

        $this->dependencies = $this->dependencies->addSet(
            $this->currentClass,
            $this->tempDependencies
        );
        $this->tempDependencies = new DependencySet();
        $this->currentClass = null;
    }
public function leaveNode(Node $node)
    {
        if (!$node instanceof ClassLikeNode) {
            return null;
        }

        // not in class context
        if ($this->currentClass === null) {
            $this->tempDependencies = new DependencySet();
            return;
        }

        // by now the class should have been parsed so replace the
        // temporary class with the parsed class name

        $this->dependencies = $this->dependencies->addSet(
            $this->currentClass,
            $this->tempDependencies
        );
        $this->tempDependencies = new DependencySet();
        $this->currentClass = null;
    }
public function leaveNode ( Node $ node ) { if ( ! $ node instanceof ClassLikeNode ) { return null ; } // not in class context if ( $ this -> currentClass === null ) { $ this -> tempDependencies = new DependencySet ( ) ; return ; } // by now the class should have been parsed so replace the // temporary class with the parsed class name $ this -> dependencies = $ this -> dependencies -> addSet ( $ this -> currentClass , $ this -> tempDependencies ) ; $ this -> tempDependencies = new DependencySet ( ) ; $ this -> currentClass = null ; }
As described in beforeTraverse we are going to update the class we are
currently parsing for all dependencies. If we are not in class context
we won't add the dependencies.

@param Node $node

@return false|null|Node|\PhpParser\Node[]|void
As described in beforeTraverse we are going to update the class we are currently parsing for all dependencies . If we are not in class context we won t add the dependencies .