| Conditions | 2 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 37 | public function prune(DateTimeInterface $before) |
||
| 38 | { |
||
| 39 | $query = $this->table('otps')->where('expired', true)->orWhere('created_at', '<', $before); |
||
| 40 | |||
| 41 | $totalDeleted = 0; |
||
| 42 | |||
| 43 | do { |
||
| 44 | $deleted = $query->take(100)->delete(); |
||
| 45 | |||
| 46 | $totalDeleted += $deleted; |
||
| 47 | } while ($deleted !== 0); |
||
| 48 | |||
| 49 | return $totalDeleted; |
||
| 50 | } |
||
| 73 |