/** * * * @param \PhpParser\Node $node */ public function enterNode(\PhpParser\Node $node) { $this->contextStack[] = $node; if ($node instanceof Node\Stmt\Namespace_) { $this->currentNamespace = $this->classFactory->buildNamespaceObject($node); $this->currentContainer = $this->currentNamespace; } elseif ($node instanceof Node\Stmt\Class_) { $this->currentClassObject = $this->classFactory->buildClassObject($node); $this->currentContainer = $this->currentClassObject; } }
/** * * * @param \PHPParser_Node $node */ public function enterNode(\PHPParser_Node $node) { $this->contextStack[] = $node; if ($node instanceof \PHPParser_Node_Stmt_Namespace) { $this->currentNamespace = $this->classFactory->buildNamespaceObject($node); $this->currentContainer = $this->currentNamespace; } elseif ($node instanceof \PHPParser_Node_Stmt_Class) { $this->currentClassObject = $this->classFactory->buildClassObject($node); $this->currentContainer = $this->currentClassObject; } }