File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
src/Command/ErrorFormatter
tests/PHPStan/Command/ErrorFormatter Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1616use function in_array ;
1717use function is_string ;
1818use function ltrim ;
19+ use function rtrim ;
1920use function sprintf ;
2021use function str_contains ;
2122use function str_replace ;
@@ -83,7 +84,7 @@ public function formatErrors(
8384 $ filePath = $ error ->getTraitFilePath () ?? $ error ->getFilePath ();
8485 if ($ error ->getIdentifier () !== null && $ error ->canBeIgnored ()) {
8586 $ message .= "\n" ;
86- $ message .= '🪪 ' . $ error ->getIdentifier ();
87+ $ message .= '🪪 ' . $ error ->getIdentifier ();
8788 }
8889 if ($ error ->getTip () !== null ) {
8990 $ tip = $ error ->getTip ();
@@ -95,6 +96,7 @@ public function formatErrors(
9596 foreach ($ lines as $ line ) {
9697 $ message .= '💡 ' . ltrim ($ line , ' • ' ) . "\n" ;
9798 }
99+ $ message = rtrim ($ message , "\n" );
98100 } else {
99101 $ message .= '💡 ' . $ tip ;
100102 }
@@ -116,7 +118,7 @@ public function formatErrors(
116118 $ title = $ this ->relativePathHelper ->getRelativePath ($ filePath );
117119 }
118120
119- $ message .= "\n✏️ <href= " . OutputFormatter::escape ($ url ) . '> ' . $ title . '</> ' ;
121+ $ message .= "\n✏️ <href= " . OutputFormatter::escape ($ url ) . '> ' . $ title . '</> ' ;
120122 }
121123
122124 if (
Original file line number Diff line number Diff line change @@ -190,13 +190,13 @@ public function dataFormatterOutputProvider(): iterable
190190 'numGenericErrors ' => 0 ,
191191 'verbose ' => false ,
192192 'extraEnvVars ' => [],
193- 'expected ' => ' ------ ----------------
193+ 'expected ' => ' ------ ---------------
194194 Line foo.php
195- ------ ----------------
195+ ------ ---------------
196196 5 Foobar\Buz
197- 🪪 foobar.buz
197+ 🪪 foobar.buz
198198 💡 a tip
199- ------ ----------------
199+ ------ ---------------
200200
201201
202202 [ERROR] Found 1 error
@@ -211,13 +211,13 @@ public function dataFormatterOutputProvider(): iterable
211211 'numGenericErrors ' => 0 ,
212212 'verbose ' => true ,
213213 'extraEnvVars ' => [],
214- 'expected ' => ' ------ ----------------
214+ 'expected ' => ' ------ ---------------
215215 Line foo.php
216- ------ ----------------
216+ ------ ---------------
217217 5 Foobar\Buz
218- 🪪 foobar.buz
218+ 🪪 foobar.buz
219219 💡 a tip
220- ------ ----------------
220+ ------ ---------------
221221
222222
223223 [ERROR] Found 1 error
You can’t perform that action at this time.
0 commit comments