| 1 | <?php |
||
| 5 | trait ExecutionTime |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Set PHP max execution time |
||
| 10 | * Skips setting in tests to avoid timeout issues |
||
| 11 | * |
||
| 12 | * @param int $seconds |
||
| 13 | */ |
||
| 14 | protected function setMaxExecution(int $seconds): void |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Get max execution time |
||
| 21 | * |
||
| 22 | * @return int |
||
| 23 | */ |
||
| 24 | protected function getMaxExecution(): int |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param int $executionTime |
||
| 31 | * @param callable $callback |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | protected function withExecutionTime(int $executionTime, callable $callback) |
||
| 46 | } |
||
| 47 |