| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function to($numbers) |
||
| 38 | { |
||
| 39 | $recipients = is_array($numbers) ? $numbers : [$numbers]; |
||
| 40 | $recipients = array_map(function ($item) { |
||
| 41 | return trim($item); |
||
| 42 | }, array_merge($this->recipients, $recipients)); |
||
| 43 | |||
| 44 | $this->recipients = array_values(array_filter($recipients)); |
||
| 45 | |||
| 46 | if (count($this->recipients) < 1) { |
||
| 47 | throw new \Exception('Message recipient could not be empty.'); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 80 |