| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Cleaner |
||
| 9 | { |
||
| 10 | use OptionalConstructor; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Dropped rows counter limit |
||
| 14 | */ |
||
| 15 | protected int $limit = 100; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Space name |
||
| 19 | */ |
||
| 20 | protected string $space = 'lock'; |
||
| 21 | |||
| 22 | protected function validateOptions() |
||
| 23 | { |
||
| 24 | if ($this->limit <= 0) { |
||
| 25 | $message = sprintf( |
||
| 26 | 'limit expects a strictly positive TTL. Got %d.', |
||
| 27 | $this->limit |
||
| 28 | ); |
||
| 29 | throw new InvalidArgumentException($message); |
||
| 30 | } |
||
| 31 | if ($this->space == '') { |
||
| 32 | throw new InvalidArgumentException("Space should be defined"); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | public function process(): int |
||
| 56 | } |
||
| 57 | } |
||
| 58 |