/** * @inheritdoc */ public function run($root) { $this->extendIndicies = []; $finder = new ExtendFinderVisitor(); $finder->run($root); if (!$finder->foundExtends) { return $root; } $root->allExtends = $this->doExtendChaining($root->allExtends, $root->allExtends); $this->allExtendsStack = [&$root->allExtends]; $newRoot = $this->visit($root); $this->checkExtendsForNonMatched($root->allExtends); return $newRoot; }