Skip to content

Commit 3dfa78f

Browse files
committed
Revert "OXDEV-9553 Fix getting the last child in a template chain"
This reverts commit 8b31feb.
1 parent 8b31feb commit 3dfa78f

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

src/Resolver/TemplateChain/DataObject/TemplateChain.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,8 @@ public function getParent(TemplateTypeInterface $templateType): TemplateTypeInte
7676

7777
public function getLastChild(): TemplateTypeInterface
7878
{
79-
$extendedNamespaces = [];
80-
$lastChild = null;
81-
82-
foreach ($this->chain as $templateType) {
83-
$parentNamespace = $templateType->getParentNamespace();
84-
if ($parentNamespace) {
85-
$extendedNamespaces[$parentNamespace] = true;
86-
}
87-
if (!isset($extendedNamespaces[$templateType->getNamespace()])) {
88-
$lastChild = $templateType;
89-
}
90-
}
91-
92-
return $lastChild ?? reset($this->chain);
79+
reset($this->chain);
80+
return current($this->chain);
9381
}
9482

9583
public function hasParent(TemplateTypeInterface $templateType): bool

0 commit comments

Comments
 (0)