public function processFileScope(Index $index, $nodes) { $this->getLogger()->debug('Processing nodes ' . count($nodes)); foreach ($nodes as $node) { if ($node instanceof ClassData) { $this->getLogger()->debug('Processing node ' . $node->fqcn->toString()); $index->addFQCN($node->fqcn); $index->addClass($node); } elseif ($node instanceof InterfaceData) { $this->getLogger()->debug('Processing node ' . $node->fqcn->toString()); $index->addFQCN($node->fqcn); $index->addInterface($node); } } }
protected function getParentType(FQCN $type, Index $index) { $class = $index->findClassByFQCN($type); if (empty($class)) { return null; } $parent = $class->getParent(); if (empty($parent)) { return null; } return $parent->fqcn; }