| Conditions | 3 |
| Paths | 7 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 3 | public function manifest(ConnectionInterface $connection, Session $session): Session |
|
| 33 | { |
||
| 34 | try { |
||
| 35 | 3 | $address = new EmailAddress(\substr($session->getCommand(), 9, -1)); |
|
| 36 | |||
| 37 | 2 | if ($this->backend->contains($address) === false) { |
|
| 38 | 1 | $connection->send('550 Unknown mailbox'); |
|
| 39 | 1 | return $session; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | $connection->send('250 OK'); |
|
| 43 | 1 | return $session->withRecipient($address); |
|
| 44 | 1 | } catch (\InvalidArgumentException $e) { |
|
| 45 | 1 | $connection->send('501 Invalid recipient'); |
|
| 46 | 1 | return $session; |
|
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 58 |