Total Complexity | 6 |
Total Lines | 54 |
Duplicated Lines | 0 % |
Coverage | 86.67% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | class BenchmarkOptions |
||
8 | { |
||
9 | /** @var bool */ |
||
10 | protected $cli = false; |
||
11 | |||
12 | /** @var int */ |
||
13 | protected $maxIterations; |
||
14 | /** @var int */ |
||
15 | protected $progressThreshold; |
||
16 | |||
17 | /** |
||
18 | * BenchmarkOptions constructor. |
||
19 | */ |
||
20 | 17 | public function __construct() |
|
21 | { |
||
22 | 17 | if (PHP_SAPI === 'cli') { |
|
23 | 17 | $this->cli = true; |
|
24 | } |
||
25 | 17 | $this->setMaxIterations(5); |
|
26 | 17 | } |
|
27 | |||
28 | /** |
||
29 | * @return int |
||
30 | */ |
||
31 | 17 | public function getProgressThreshold(): int |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @return int |
||
38 | */ |
||
39 | 17 | public function getMaxIterations(): int |
|
40 | { |
||
41 | 17 | return $this->maxIterations; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * @param int $maxIterations |
||
46 | * @return BenchmarkOptions |
||
47 | */ |
||
48 | 17 | public function setMaxIterations(int $maxIterations): self |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function isCli(): bool |
||
61 | } |
||
62 | } |
||
63 |