Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
48 | protected function sendEmails($emails) |
||
49 | { |
||
50 | if (count($emails) < 1) { |
||
51 | return false; |
||
52 | } |
||
53 | $sent = 0; |
||
54 | $recipients = 0; |
||
55 | foreach ($emails as $email) { |
||
56 | echo 'send email [ID:' . $email->id . '][TO:' . implode(',', array_keys($email->getTos())) . ']'; |
||
57 | try { |
||
58 | $recipients = $email->send(); |
||
59 | $sent++; |
||
60 | } catch (Exception $exception) { |
||
61 | echo $exception->getMessage(); |
||
62 | // die(''); |
||
63 | } |
||
64 | echo '[R:' . $recipients . ']<br />' . "\n"; |
||
65 | } |
||
66 | return $sent; |
||
67 | } |
||
85 |
If the returned type also contains false, it is an indicator that maybe an error condition leading to the specific return statement remains unhandled.