| Conditions | 3 |
| Paths | 6 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 4 | public function send(AbstractMessage $message): void |
|
| 31 | { |
||
| 32 | try { |
||
| 33 | 4 | $text = $message->render(); |
|
| 34 | 4 | $address = $message->getAddress(); |
|
| 35 | |||
| 36 | 4 | $filename = $this->getPath() . '/' . $address->__toString() . '_' . $this->getTimestamp() . '.txt'; |
|
| 37 | |||
| 38 | 4 | if (! $this->putContents($filename, $text)) { |
|
| 39 | 4 | throw new \RuntimeException('Unable to write data'); |
|
| 40 | } |
||
| 41 | 1 | } catch (\Exception $exception) { |
|
| 42 | 1 | throw new TransportException('Unable to send message', 1, $exception); |
|
| 43 | } |
||
| 81 |