/** * Retrieve list of parents * * @param string $type * @return array */ public function getParents($type) { if (!class_exists($type)) { return $this->_default; } return $this->_classReader->getParents($type) ?: $this->_default; }
/** * Retrieves list of classes for given path * * @param string $path path to dir with files * * @return array */ public function getList($path) { foreach ($this->classesScanner->getList($path) as $className) { $this->current = $className; // for errorHandler function try { if ($path != $this->generationDir) { // validate all classes except classes in generation dir $this->validator->validate($className); } $this->relations[$className] = $this->classReader->getParents($className); } catch (\Magento\Framework\Exception\ValidatorException $exception) { $this->log->add(Log::COMPILATION_ERROR, $className, $exception->getMessage()); } catch (\ReflectionException $e) { $this->log->add(Log::COMPILATION_ERROR, $className, $e->getMessage()); } } return $this->relations; }
/** * Retrieve parent relation information for type in a following format * array( * 'Parent_Class_Name', * 'Interface_1', * 'Interface_2', * ... * ) * * @param string $className * @return string[] */ public function getParents($className) { return $this->classReader->getParents($className); }