Skip to content

Commit 9967f48

Browse files
committed
Deduplicate $internalFileSpecificErrors
1 parent 4f75ba6 commit 9967f48

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Command/AnalyseCommand.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
362362
}
363363

364364
if (!$hasStackTrace) {
365-
$internalFileSpecificErrors[] = $fileSpecificError;
365+
if (!array_key_exists($fileSpecificError->getMessage(), $internalFileSpecificErrors)) {
366+
$internalFileSpecificErrors[$fileSpecificError->getMessage()] = $fileSpecificError;
367+
}
366368
}
367369

368370
$internalErrorsTuples[$fileSpecificError->getMessage()] = [new InternalError(
@@ -442,7 +444,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
442444

443445
if (count($internalErrorsTuples) > 0) {
444446
$analysisResult = new AnalysisResult(
445-
$internalFileSpecificErrors,
447+
array_values($internalFileSpecificErrors),
446448
array_map(static fn (InternalError $internalError) => $internalError->getMessage(), $internalErrors),
447449
[],
448450
[],

0 commit comments

Comments
 (0)