Total Complexity | 4 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | class DefaultTimeoutChecker implements TimeoutChecker |
||
17 | { |
||
18 | private float $startTime; |
||
19 | |||
20 | public function __construct(readonly private float $timeout) |
||
22 | } |
||
23 | |||
24 | public function start(?float $startTime = null): void |
||
25 | { |
||
26 | $this->startTime = $startTime ?? microtime(true); |
||
27 | } |
||
28 | |||
29 | public function throwOnTimeout(?float $currentTime = null, string $message = 'Exceeded the timeout'): void |
||
35 | } |
||
36 | } |
||
38 |