| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.1406 |
| Changes | 0 | ||
| 1 | <?php |
||
| 70 | 1 | private function getSubmissionTimestamp(MessageInterface $message): int |
|
| 71 | { |
||
| 72 | 1 | $queuedAt = $message->getHeader(QueueIfFailedTransport::QUEUED_HEADER); |
|
| 73 | 1 | if (!\is_array($queuedAt)) { |
|
| 74 | $queuedAt = \iterator_to_array($queuedAt); |
||
| 75 | } |
||
| 76 | |||
| 77 | 1 | $header = \reset($queuedAt); |
|
| 78 | 1 | if ($header === false) { |
|
| 79 | throw new \UnexpectedValueException('Cannot extract queue header from message'); |
||
| 80 | } |
||
| 81 | |||
| 82 | 1 | return (int) \strtotime($header->getValue()->getRaw()); |
|
| 83 | } |
||
| 84 | } |
||
| 85 |