| Conditions | 5 |
| Paths | 9 |
| Total Lines | 19 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function getHeaders(Message $message): array |
||
| 18 | { |
||
| 19 | $headers = []; |
||
| 20 | |||
| 21 | foreach ($message->getPayload()->getHeaders() as $header) { |
||
| 22 | if ('From' === $header->name) { |
||
| 23 | $headers['from'] = $header->value; |
||
| 24 | } |
||
| 25 | |||
| 26 | if ('Subject' === $header->name) { |
||
| 27 | $headers['subject'] = $header->value; |
||
| 28 | } |
||
| 29 | |||
| 30 | if (2 === count($headers)) { |
||
| 31 | break; |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | return $headers; |
||
| 36 | } |
||
| 56 |