diff --git a/src/Command/AnalyseCommand.php b/src/Command/AnalyseCommand.php index 3251417c46..a92f85f720 100644 --- a/src/Command/AnalyseCommand.php +++ b/src/Command/AnalyseCommand.php @@ -362,7 +362,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int } if (!$hasStackTrace) { - $internalFileSpecificErrors[] = $fileSpecificError; + if (!array_key_exists($fileSpecificError->getMessage(), $internalFileSpecificErrors)) { + $internalFileSpecificErrors[$fileSpecificError->getMessage()] = $fileSpecificError; + } } $internalErrorsTuples[$fileSpecificError->getMessage()] = [new InternalError( @@ -442,7 +444,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (count($internalErrorsTuples) > 0) { $analysisResult = new AnalysisResult( - $internalFileSpecificErrors, + array_values($internalFileSpecificErrors), array_map(static fn (InternalError $internalError) => $internalError->getMessage(), $internalErrors), [], [],