We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b31feb commit 3dfa78fCopy full SHA for 3dfa78f
1 file changed
src/Resolver/TemplateChain/DataObject/TemplateChain.php
@@ -76,20 +76,8 @@ public function getParent(TemplateTypeInterface $templateType): TemplateTypeInte
76
77
public function getLastChild(): TemplateTypeInterface
78
{
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);
+ reset($this->chain);
+ return current($this->chain);
93
}
94
95
public function hasParent(TemplateTypeInterface $templateType): bool
0 commit comments