/** * Inherits the properties of an element in another class. * * @param PropertyNode $parent parent property to inherit from. * * @return void */ public function inherit($parent) { $docblock = $this->getDocBlock(); $docblock->inherited_tags = array_merge($docblock->inherited_tags, $this->inherited_tags); $docblock->inherit($parent->getDocBlock()); $this->getNode()->appendChild(new \DOMElement('override_from', $this->class->getFQCN())); }
/** * Inherits the given parent as if it was an class. * * @param ClassNode $parent Parent class to inherit from. * * @todo this method and inheritInterface should be separated into * different objects * * @return void */ protected function inheritClassObject(ClassNode $parent) { // if the parent class has not processed yet; do so. This will cause // a recurring effect which makes sure the tree is traversed bottom-to-top if (!$parent->is_processed) { $parent->setNodes($this->nodes); $parent->inherit(null); } $docblock = $this->getDocBlock(); $docblock->inherited_tags[] = 'package'; $docblock->inherited_tags[] = 'subpackage'; $docblock->inherit($parent->getDocBlock()); $this->inheritConstants($parent); $this->inheritProperties($parent); $this->inheritMethods($parent); }