Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
42 | 7 | public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null) |
|
43 | { |
||
44 | 7 | if (!$message instanceof Swift_Message) { |
|
45 | 1 | throw new InvalidParamException('The message should be an instance of "Swift_Message".'); |
|
46 | } |
||
47 | 6 | $failedRecipients = (array) $failedRecipients; |
|
48 | 6 | $importedMessage = new ImportedMessage($message); |
|
49 | |||
50 | 6 | if ($this->mailer->send($importedMessage)) { |
|
51 | 5 | return count($importedMessage->getTo()); |
|
52 | } else { |
||
53 | 1 | $failedRecipients = (array) $importedMessage->getTo(); |
|
54 | 1 | return 0; |
|
55 | } |
||
96 |