77use PHPStan \Command \ErrorFormatter \ErrorFormatter ;
88use PHPStan \Command \Output ;
99use PHPStan \File \RelativePathHelper ;
10+ use PHPStan \File \SimpleRelativePathHelper ;
1011use Yamadashy \PhpStanFriendlyFormatter \Config \FriendlyFormatterConfig ;
1112use Yamadashy \PhpStanFriendlyFormatter \ErrorFormat \ErrorWriter ;
1213use Yamadashy \PhpStanFriendlyFormatter \ErrorFormat \SummaryWriter ;
@@ -16,12 +17,21 @@ class FriendlyErrorFormatter implements ErrorFormatter
1617 /** @var RelativePathHelper */
1718 private $ relativePathHelper ;
1819
20+ /** @var SimpleRelativePathHelper */
21+ private $ simpleRelativePathHelper ;
22+
1923 /** @var FriendlyFormatterConfig */
2024 private $ config ;
2125
22- public function __construct (RelativePathHelper $ relativePathHelper , int $ lineBefore , int $ lineAfter , ?string $ editorUrl )
23- {
26+ public function __construct (
27+ RelativePathHelper $ relativePathHelper ,
28+ SimpleRelativePathHelper $ simpleRelativePathHelper ,
29+ int $ lineBefore ,
30+ int $ lineAfter ,
31+ ?string $ editorUrl
32+ ) {
2433 $ this ->relativePathHelper = $ relativePathHelper ;
34+ $ this ->simpleRelativePathHelper = $ simpleRelativePathHelper ;
2535 $ this ->config = new FriendlyFormatterConfig (
2636 $ lineBefore ,
2737 $ lineAfter ,
@@ -40,7 +50,7 @@ public function formatErrors(AnalysisResult $analysisResult, Output $output): in
4050
4151 $ output ->writeLineFormatted ('' );
4252
43- $ errorWriter = new ErrorWriter ($ this ->relativePathHelper , $ this ->config );
53+ $ errorWriter = new ErrorWriter ($ this ->relativePathHelper , $ this ->simpleRelativePathHelper , $ this -> config );
4454 $ errorWriter ->writeFileSpecificErrors ($ analysisResult , $ output );
4555 $ errorWriter ->writeNotFileSpecificErrors ($ analysisResult , $ output );
4656 $ errorWriter ->writeWarnings ($ analysisResult , $ output );
0 commit comments