Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | 1 | public function __construct( |
|
8 | int $iterations = 1000, |
||
9 | bool $quiet = false |
||
10 | ) { |
||
11 | 1 | parent::__construct($iterations); |
|
12 | 1 | $width = $this->advanceSteps = $this->terminalWidth(); |
|
13 | // @codeCoverageIgnoreStart |
||
14 | if (!$quiet) { |
||
15 | $progressStart = |
||
16 | static function () use ($width): void { |
||
17 | echo ' [' . str_repeat('░', $width) . ']'; |
||
18 | echo "\e[" . ($width + 1) . 'D'; |
||
19 | }; |
||
20 | $progressAdvance = |
||
21 | static function (): void { |
||
22 | echo '█'; |
||
23 | }; |
||
24 | |||
25 | $progressFinish = |
||
26 | static function () use ($width): void { |
||
27 | echo "\e[" . ($width + 1) . 'D'; |
||
28 | echo "\e[K"; |
||
29 | }; |
||
30 | |||
31 | $this->showProgressBy($progressStart, $progressAdvance, $progressFinish); |
||
32 | } |
||
36 |