| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 3 | public function start(BusContextInterface $busContext) |
|
| 44 | { |
||
| 45 | 3 | if ($this->daysToKeepDeduplicationData === null) { |
|
| 46 | 1 | $this->daysToKeepDeduplicationData = 7; |
|
| 47 | 2 | } elseif (!ctype_digit((string)$this->daysToKeepDeduplicationData)) { |
|
| 48 | 1 | throw new UnexpectedValueException( |
|
| 49 | 1 | "Invalid value value used for days to keep deduplication data. Please ensure it is a positive integer." |
|
| 50 | ); |
||
| 51 | } |
||
| 52 | |||
| 53 | 2 | $this->outboxPersister->removeEntriesOlderThan( |
|
| 54 | 2 | $this->now->sub(new \DateInterval("P{$this->daysToKeepDeduplicationData}D")) |
|
| 55 | ); |
||
| 56 | 2 | } |
|
| 57 | } |
||
| 58 |