/** * @param BusContextInterface $busContext * * @throws UnexpectedValueException */ public function start(BusContextInterface $busContext) { if ($this->daysToKeepDeduplicationData === null) { $this->daysToKeepDeduplicationData = 7; } elseif (!ctype_digit((string) $this->daysToKeepDeduplicationData)) { throw new UnexpectedValueException("Invalid value value used for days to keep deduplication data. Please ensure it is a positive integer."); } $this->outboxPersister->removeEntriesOlderThan($this->now->sub(new \DateInterval("P{$this->daysToKeepDeduplicationData}D"))); }