Skip to content

Commit 30d6511

Browse files
committed
AC-15170:Add official support for Symfony 7.4 LTS in Adobe Commerce 2.4.9
1 parent ad1c7ae commit 30d6511

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/Analyzer/ClassMethodAnalyzer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ private function addAncestorsToArray(array $ancestors, $toAdd)
541541
private function analyzeRemainingConstructorParams($contextAfter, $methodAfter, $remainingAfter)
542542
{
543543
if (Signature::isOptionalParams($remainingAfter)) {
544-
$namespace = implode('\\', $contextAfter->jsonSerialize()['namespacedName']->parts);
544+
$namespaceNode = $contextAfter->namespacedName ?? null;
545+
$namespace = $namespaceNode instanceof Name ? $namespaceNode->toString() : '';
545546
if (in_array($namespace, $this->extendableApiClassList)) {
546547
$data = new ExtendableClassConstructorOptionalParameterAdded(
547548
$this->context,

src/Helper/ClassParser.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ public function getParentFullClassName()
8484
$nodeTree = $this->getNamespaceNode();
8585
foreach ($nodeTree->stmts as $stmt) {
8686
if ($stmt instanceof Class_ && $stmt->extends !== null) {
87-
if (count($stmt->extends->parts) > 1) {
88-
return implode("\\", $stmt->extends->parts);
87+
$extendsName = $stmt->extends;
88+
if (count($extendsName->getParts()) > 1) {
89+
return $extendsName->toString();
8990
}
90-
$extendedClass = end($stmt->extends->parts);
91+
$extendedClass = $extendsName->getLast();
9192
}
9293
}
9394

@@ -96,8 +97,12 @@ public function getParentFullClassName()
9697
}
9798

9899
foreach ($nodeTree->stmts as $stmt) {
99-
if ($stmt instanceof Use_ && $stmt->uses[0]->getAlias()->toString() === $extendedClass) {
100-
return implode("\\", $stmt->uses[0]->name->parts);
100+
if ($stmt instanceof Use_) {
101+
foreach ($stmt->uses as $useUse) {
102+
if ($useUse->getAlias()->toString() === $extendedClass) {
103+
return $useUse->name->toString();
104+
}
105+
}
101106
}
102107
}
103108

0 commit comments

Comments
 (0)