| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 60 | 3 | private function deleteLogsBySteps(int $steps) |
|
| 61 | { |
||
| 62 | 3 | $logs = $this->mappingLogRepository->all(); |
|
| 63 | |||
| 64 | 3 | if ($steps >= count($logs)) { |
|
| 65 | 2 | $this->mappingLogRepository->reset(); |
|
| 66 | } |
||
| 67 | |||
| 68 | 3 | $logs = array_slice( |
|
| 69 | 3 | array_reverse($logs), |
|
| 70 | 3 | 0, |
|
| 71 | 3 | $steps |
|
| 72 | ); |
||
| 73 | |||
| 74 | 3 | foreach ($logs as $log) { |
|
| 75 | 3 | $this->mappingLogRepository->delete($log['id']); |
|
| 76 | } |
||
| 79 |