Skip to content

Commit f65e1e5

Browse files
committed
Merge branch 2.1.x into 2.2.x
2 parents 28b0c25 + 7859ab8 commit f65e1e5

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/Command/ErrorFormatter/TableErrorFormatter.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ public function formatErrors(
110110
foreach ($errors as $error) {
111111
$message = $error->getMessage();
112112
$filePath = $error->getTraitFilePath() ?? $error->getFilePath();
113+
if (
114+
$error->getIdentifier() !== null
115+
&& in_array($error->getIdentifier(), ['phpstan.type', 'phpstan.nativeType', 'phpstan.variable', 'phpstan.dumpType', 'phpstan.unknownExpectation'], true)
116+
) {
117+
$message = '<fg=red>' . OutputFormatter::escape($message) . '</>';
118+
}
113119
if ($error->getIdentifier() !== null) {
114120
$message .= "\n";
115121
$message .= '🪪 ' . $error->getIdentifier();
@@ -157,13 +163,6 @@ public function formatErrors(
157163
$message .= "\n✏️ <href=" . OutputFormatter::escape($url) . '>' . $title . '</>';
158164
}
159165

160-
if (
161-
$error->getIdentifier() !== null
162-
&& in_array($error->getIdentifier(), ['phpstan.type', 'phpstan.nativeType', 'phpstan.variable', 'phpstan.dumpType', 'phpstan.unknownExpectation'], true)
163-
) {
164-
$message = '<fg=red>' . $message . '</>';
165-
}
166-
167166
$rows[] = [
168167
$this->formatLineNumber($error->getLine()),
169168
$message,

0 commit comments

Comments
 (0)