Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
10 | public function __construct( |
||
11 | int $iterations = 1000, |
||
12 | bool $quiet = false, |
||
13 | SpinnerInterface $spinner = null |
||
14 | ) { |
||
15 | parent::__construct($iterations); |
||
16 | $this->advanceSteps = $this->terminalWidth(); |
||
17 | // @codeCoverageIgnoreStart |
||
18 | if (!$quiet) { |
||
19 | $s = $spinner ?? new SnakeSpinner('Benchmarking'); |
||
20 | $progressStart = |
||
21 | static function () use ($s): void { |
||
22 | echo $s->begin(); |
||
23 | }; |
||
24 | |||
25 | $progressAdvance = |
||
26 | static function () use ($s): void { |
||
27 | echo $s->spin(); |
||
28 | }; |
||
29 | |||
30 | $progressFinish = |
||
31 | static function () use ($s): void { |
||
32 | echo $s->end(); |
||
33 | }; |
||
34 | |||
35 | $this->showProgressBy($progressStart, $progressAdvance, $progressFinish); |
||
36 | } |
||
40 |