|
15 | 15 | use function ksort;
|
16 | 16 | use function max;
|
17 | 17 | use function sprintf;
|
18 |
| -use function str_pad; |
19 | 18 | use function strlen;
|
20 | 19 | use SebastianBergmann\CodeCoverage\CodeCoverage;
|
21 | 20 | use SebastianBergmann\CodeCoverage\Node\File;
|
@@ -166,25 +165,25 @@ public function process(CodeCoverage $coverage, bool $showColors = false): strin
|
166 | 165 | $title = 'Code Coverage Report Summary:';
|
167 | 166 | $padding = max($padding, strlen($title));
|
168 | 167 |
|
169 |
| - $output .= $this->format($colors['header'], $padding, $title); |
| 168 | + $output .= $this->format($colors['header'], $title); |
170 | 169 | } else {
|
171 | 170 | $date = date(' Y-m-d H:i:s');
|
172 | 171 | $title = 'Code Coverage Report:';
|
173 | 172 |
|
174 |
| - $output .= $this->format($colors['header'], $padding, $title); |
175 |
| - $output .= $this->format($colors['header'], $padding, $date); |
176 |
| - $output .= $this->format($colors['header'], $padding, ''); |
177 |
| - $output .= $this->format($colors['header'], $padding, ' Summary:'); |
| 173 | + $output .= $this->format($colors['header'], $title); |
| 174 | + $output .= $this->format($colors['header'], $date); |
| 175 | + $output .= $this->format($colors['header'], ''); |
| 176 | + $output .= $this->format($colors['header'], ' Summary:'); |
178 | 177 | }
|
179 | 178 |
|
180 |
| - $output .= $this->format($colors['classes'], $padding, $classes); |
181 |
| - $output .= $this->format($colors['methods'], $padding, $methods); |
| 179 | + $output .= $this->format($colors['classes'], $classes); |
| 180 | + $output .= $this->format($colors['methods'], $methods); |
182 | 181 |
|
183 | 182 | if ($hasBranchCoverage) {
|
184 |
| - $output .= $this->format($colors['paths'], $padding, $paths); |
185 |
| - $output .= $this->format($colors['branches'], $padding, $branches); |
| 183 | + $output .= $this->format($colors['paths'], $paths); |
| 184 | + $output .= $this->format($colors['branches'], $branches); |
186 | 185 | }
|
187 |
| - $output .= $this->format($colors['lines'], $padding, $lines); |
| 186 | + $output .= $this->format($colors['lines'], $lines); |
188 | 187 |
|
189 | 188 | if ($this->showOnlySummary) {
|
190 | 189 | return $output . PHP_EOL;
|
@@ -304,10 +303,10 @@ private function printCoverageCounts(int $numberOfCoveredElements, int $totalNum
|
304 | 303 | sprintf($format, $totalNumberOfElements) . ')';
|
305 | 304 | }
|
306 | 305 |
|
307 |
| - private function format(string $color, int $padding, false|string $string): string |
| 306 | + private function format(string $color, false|string $string): string |
308 | 307 | {
|
309 | 308 | $reset = $color ? self::COLOR_RESET : '';
|
310 | 309 |
|
311 |
| - return $color . str_pad((string) $string, $padding) . $reset . PHP_EOL; |
| 310 | + return $color . $string . $reset . PHP_EOL; |
312 | 311 | }
|
313 | 312 | }
|
0 commit comments