File tree Expand file tree Collapse file tree
src/Command/ErrorFormatter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212use PHPStan \File \SimpleRelativePathHelper ;
1313use Symfony \Component \Console \Formatter \OutputFormatter ;
1414use function array_map ;
15+ use function array_slice ;
1516use function count ;
1617use function explode ;
1718use function getenv ;
@@ -159,12 +160,15 @@ public function formatErrors(
159160 ];
160161 }
161162
162- $ style ->table (['Line ' , $ this ->relativePathHelper ->getRelativePath ($ file )], $ rows );
163163 $ printedErrors += count ($ rows );
164-
165164 if ($ errorsBudget > 0 && $ printedErrors > $ errorsBudget ) {
165+ $ rows = array_slice ($ rows , 0 , $ errorsBudget - ($ printedErrors - count ($ rows )));
166+
167+ $ style ->table (['Line ' , $ this ->relativePathHelper ->getRelativePath ($ file )], $ rows );
166168 break ;
167169 }
170+
171+ $ style ->table (['Line ' , $ this ->relativePathHelper ->getRelativePath ($ file )], $ rows );
168172 }
169173
170174 if (count ($ analysisResult ->getNotFileSpecificErrors ()) > 0 ) {
You can’t perform that action at this time.
0 commit comments