Skip to content

Commit 6d0a349

Browse files
committed
Merge branch 'ACP2E-2838' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-01-26-2024
2 parents 40e0091 + 965f113 commit 6d0a349

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 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(),
@@ -77,7 +76,19 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
7776
$analysisResult->getProjectConfigFile(),
7877
$analysisResult->isResultCacheSaved(),
7978
$analysisResult->getPeakMemoryUsageBytes()
80-
);
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);
8192

8293
return $this->tableErrorFormatter->formatErrors($clearedAnalysisResult, $output);
8394
}

0 commit comments

Comments
 (0)