Conditions | 2 |
Paths | 5 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0932 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 1 | public function send(AbstractMessage $message): void |
|
31 | { |
||
32 | try { |
||
33 | 1 | $text = $message->render(); |
|
34 | 1 | $address = $message->getAddress(); |
|
35 | |||
36 | 1 | $filename = $this->getPath() . '/' . $address->__toString() . '_' . strtotime('now') . '.txt'; |
|
37 | |||
38 | 1 | file_put_contents($filename, $text); |
|
39 | } catch (\Exception $exception) { |
||
40 | throw new TransportException('Unable to send message', 1, $exception); |
||
41 | } |
||
55 |