Phan\Language\Element\Clazz::importParentClass PHP Метод

importParentClass() публичный Метод

* Add properties, constants and methods from the parent of this class
public importParentClass ( CodeBase $code_base )
$code_base Phan\CodeBase The entire code base from which we'll find ancestor details
    public function importParentClass(CodeBase $code_base)
    {
        if (!$this->isFirstExecution(__METHOD__)) {
            return;
        }
        if (!$this->hasParentType()) {
            return;
        }
        if ($this->getParentClassFQSEN() == $this->getFQSEN()) {
            return;
        }
        // Let the parent class finder worry about this
        if (!$code_base->hasClassWithFQSEN($this->getParentClassFQSEN())) {
            return;
        }
        assert($code_base->hasClassWithFQSEN($this->getParentClassFQSEN()), "Clazz should already have been proven to exist.");
        // Get the parent class
        $parent = $this->getParentClass($code_base);
        $parent->addReference($this->getContext());
        // Tell the parent to import its own parents first
        // Import elements from the parent
        $this->importAncestorClass($code_base, $parent, $this->getParentTypeOption());
    }