Total Complexity | 6 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
7 | class Timer extends AbstractTimer |
||
8 | { |
||
9 | /** |
||
10 | * @return float |
||
11 | */ |
||
12 | 13 | public function current(): float |
|
16 | } |
||
17 | |||
18 | /** |
||
19 | * @param float $start |
||
20 | * @param float $stop |
||
21 | */ |
||
22 | 4 | protected function assertStartAndStop($start, $stop): void |
|
23 | { |
||
24 | 4 | $this->assertStart($start); |
|
25 | 3 | $this->assertStop($stop); |
|
26 | 2 | } |
|
27 | |||
28 | /** |
||
29 | * @param $start |
||
30 | */ |
||
31 | 4 | protected function assertStart($start): void |
|
32 | { |
||
33 | 4 | if (!\is_float($start)) { |
|
34 | 1 | throw new \RuntimeException('Start value is NOT ok. [' . typeOf($start) . ']'); |
|
35 | } |
||
36 | 3 | } |
|
37 | |||
38 | /** |
||
39 | * @param $stop |
||
40 | */ |
||
41 | 3 | protected function assertStop($stop): void |
|
45 | } |
||
46 | 2 | } |
|
47 | |||
49 |