| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function send(\Zend\Mail\Message $message) |
||
| 32 | { |
||
| 33 | $options = $this->options; |
||
| 34 | $filename = call_user_func($options->getCallback(), $this); |
||
| 35 | $file = $options->getPath() . DIRECTORY_SEPARATOR . $filename; |
||
| 36 | |||
| 37 | |||
| 38 | $contents = $message->toString(); |
||
| 39 | $umask = umask(); |
||
| 40 | umask(022); |
||
| 41 | if (false === file_put_contents($file, $contents, LOCK_EX)) { |
||
| 42 | throw new RuntimeException(sprintf( |
||
| 43 | 'Unable to write mail to file (directory "%s")', |
||
| 44 | $options->getPath() |
||
| 45 | )); |
||
| 46 | } |
||
| 47 | umask($umask); |
||
| 48 | $this->lastFile = $file; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |