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