Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
13 | 1 | public function __construct( |
|
14 | int $iterations = 1000, |
||
15 | ?int $progressBarWidth = null |
||
16 | ) { |
||
17 | 1 | parent::__construct($iterations); |
|
18 | 1 | $this->progressBarWidth = $this->advanceSteps = $progressBarWidth ?? $this->advanceSteps; |
|
19 | |||
20 | $progressAdvance = |
||
21 | function (): void { |
||
22 | 1 | echo '*'; |
|
23 | 1 | }; |
|
24 | |||
25 | $progressFinish = |
||
26 | function (): void { |
||
27 | 1 | echo "\e[" . $this->advanceSteps . 'D'; |
|
28 | 1 | echo "\e[K"; |
|
29 | 1 | }; |
|
30 | |||
31 | 1 | $this->progressBar(null, $progressAdvance, $progressFinish); |
|
32 | 1 | } |
|
42 |