Skip to content

Commit 965f113

Browse files
committed
Merge branch 'ACP2E-2838' of https://github.com/adobe-commerce-tier-4/magento2ce into ACP2E-2838
2 parents 449ec9e + 2dc93c5 commit 965f113

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

dev/tests/static/framework/Magento/PhpStan/Formatters/FilteredErrorFormatter.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
6666
return self::NO_ERRORS;
6767
}
6868

69-
//@phpstan:ignore-line
70-
$clearedAnalysisResult = new AnalysisResult(
69+
$params = [
7170
$this->clearIgnoredErrors($analysisResult->getFileSpecificErrors()),
7271
$analysisResult->getNotFileSpecificErrors(),
7372
$analysisResult->getInternalErrors(),
@@ -76,9 +75,20 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
7675
$analysisResult->isDefaultLevelUsed(),
7776
$analysisResult->getProjectConfigFile(),
7877
$analysisResult->isResultCacheSaved(),
79-
$analysisResult->getPeakMemoryUsageBytes(),
80-
$analysisResult->isResultCacheUsed()
81-
);
78+
$analysisResult->getPeakMemoryUsageBytes()
79+
];
80+
81+
$reflectionClass = new \ReflectionClass(AnalysisResult::class);
82+
$constructor = $reflectionClass->getConstructor();
83+
84+
if ($constructor->getNumberOfParameters() !== count($params)
85+
&& $reflectionClass->hasMethod('isResultCacheUsed')
86+
) {
87+
$params[] = $analysisResult->isResultCacheUsed();
88+
}
89+
90+
//@phpstan:ignore-line
91+
$clearedAnalysisResult = new AnalysisResult(...$params);
8292

8393
return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);
8494
}

0 commit comments

Comments
 (0)