| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4.1967 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 2 | public function send(FormModelInterface $form, ServerRequestInterface $request) |
|
| 27 | { |
||
| 28 | 2 | $message = new Message( |
|
| 29 | 2 | $form->getAttributeValue('username'), |
|
| 30 | 2 | $form->getAttributeValue('email'), |
|
| 31 | 2 | $form->getAttributeValue('subject'), |
|
| 32 | 2 | $form->getAttributeValue('body'), |
|
| 33 | 2 | $this->to, |
|
| 34 | ); |
||
| 35 | |||
| 36 | 2 | $attachFiles = $request->getUploadedFiles(); |
|
| 37 | |||
| 38 | 2 | foreach ($attachFiles as $attachFile) { |
|
| 39 | foreach ($attachFile as $file) { |
||
| 40 | if ($file->getError() === UPLOAD_ERR_OK) { |
||
| 41 | $message->addFile($file); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | } |
||
| 45 | |||
| 46 | 2 | $this->mailer->send($message); |
|
| 47 | 2 | } |
|
| 49 |