|
9 | 9 | use PHPStan\File\RelativePathHelper;
|
10 | 10 | use PHPStan\File\SimpleRelativePathHelper;
|
11 | 11 | use Symfony\Component\Console\Formatter\OutputFormatter;
|
12 |
| -use function array_key_exists; |
13 | 12 | use function array_map;
|
14 | 13 | use function count;
|
15 | 14 | use function explode;
|
16 | 15 | use function getenv;
|
17 |
| -use function in_array; |
18 | 16 | use function is_string;
|
19 | 17 | use function ltrim;
|
20 | 18 | use function sprintf;
|
@@ -69,44 +67,20 @@ public function formatErrors(
|
69 | 67 |
|
70 | 68 | /** @var array<string, Error[]> $fileErrors */
|
71 | 69 | $fileErrors = [];
|
72 |
| - $outputIdentifiers = $output->isVerbose(); |
73 |
| - $outputIdentifiersInFile = []; |
74 | 70 | foreach ($analysisResult->getFileSpecificErrors() as $fileSpecificError) {
|
75 | 71 | if (!isset($fileErrors[$fileSpecificError->getFile()])) {
|
76 | 72 | $fileErrors[$fileSpecificError->getFile()] = [];
|
77 | 73 | }
|
78 | 74 |
|
79 | 75 | $fileErrors[$fileSpecificError->getFile()][] = $fileSpecificError;
|
80 |
| - if ($outputIdentifiers) { |
81 |
| - continue; |
82 |
| - } |
83 |
| - |
84 |
| - $filePath = $fileSpecificError->getTraitFilePath() ?? $fileSpecificError->getFilePath(); |
85 |
| - if (array_key_exists($filePath, $outputIdentifiersInFile)) { |
86 |
| - continue; |
87 |
| - } |
88 |
| - |
89 |
| - if ($fileSpecificError->getIdentifier() === null) { |
90 |
| - continue; |
91 |
| - } |
92 |
| - |
93 |
| - if (!in_array($fileSpecificError->getIdentifier(), [ |
94 |
| - 'ignore.unmatchedIdentifier', |
95 |
| - 'ignore.parseError', |
96 |
| - 'ignore.unmatched', |
97 |
| - ], true)) { |
98 |
| - continue; |
99 |
| - } |
100 |
| - |
101 |
| - $outputIdentifiersInFile[$filePath] = true; |
102 | 76 | }
|
103 | 77 |
|
104 | 78 | foreach ($fileErrors as $file => $errors) {
|
105 | 79 | $rows = [];
|
106 | 80 | foreach ($errors as $error) {
|
107 | 81 | $message = $error->getMessage();
|
108 | 82 | $filePath = $error->getTraitFilePath() ?? $error->getFilePath();
|
109 |
| - if (($outputIdentifiers || array_key_exists($filePath, $outputIdentifiersInFile)) && $error->getIdentifier() !== null && $error->canBeIgnored()) { |
| 83 | + if ($error->getIdentifier() !== null && $error->canBeIgnored()) { |
110 | 84 | $message .= "\n";
|
111 | 85 | $message .= '🪪 ' . $error->getIdentifier();
|
112 | 86 | }
|
|
0 commit comments