Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Command/ErrorFormatter/TableErrorFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function getenv;
use function is_string;
use function ltrim;
use function rtrim;
use function sprintf;
use function str_contains;
use function str_replace;
Expand Down Expand Up @@ -92,10 +93,11 @@ public function formatErrors(
if (str_contains($tip, "\n")) {
$lines = explode("\n", $tip);
foreach ($lines as $line) {
$message .= '💡 ' . ltrim($line, ' •') . "\n";
$message .= '💡 ' . ltrim($line, ' •') . "\n";
}
$message = rtrim($message, "\n");
} else {
$message .= '💡 ' . $tip;
$message .= '💡 ' . $tip;
}
}
if (is_string($this->editorUrl)) {
Expand Down
20 changes: 10 additions & 10 deletions tests/PHPStan/Command/ErrorFormatter/TableErrorFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ public function dataFormatterOutputProvider(): iterable
4 Foo
------ -------------------------------------------------------------------

------ ----------
------ -----------
Line foo.php
------ ----------
------ -----------
1 Foo<Bar>
5 Bar
Bar2
💡 a tip
------ ----------
💡 a tip
------ -----------

[ERROR] Found 4 errors

Expand Down Expand Up @@ -143,14 +143,14 @@ public function dataFormatterOutputProvider(): iterable
4 Foo
------ -------------------------------------------------------------------

------ ----------
------ -----------
Line foo.php
------ ----------
------ -----------
1 Foo<Bar>
5 Bar
Bar2
💡 a tip
------ ----------
💡 a tip
------ -----------

-- -----------------------
Error
Expand Down Expand Up @@ -195,7 +195,7 @@ public function dataFormatterOutputProvider(): iterable
------ ----------------
5 Foobar\Buz
🪪 foobar.buz
💡 a tip
💡 a tip
------ ----------------


Expand All @@ -216,7 +216,7 @@ public function dataFormatterOutputProvider(): iterable
------ ----------------
5 Foobar\Buz
🪪 foobar.buz
💡 a tip
💡 a tip
------ ----------------


Expand Down
Loading