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