| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2.0438 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function send(PhoneNumberInterface $to, MessageInterface $message, Config $config) |
||
| 31 | { |
||
| 32 | if (is_array($to)) { |
||
| 33 | $to = implode(',', $to); |
||
| 34 | } |
||
| 35 | |||
| 36 | $message = sprintf( |
||
| 37 | "[%s] to: %s | message: \"%s\" | template: \"%s\" | data: %s\n", |
||
| 38 | date('Y-m-d H:i:s'), |
||
| 39 | 1 | $to, |
|
| 40 | $message->getContent($this), |
||
| 41 | 1 | $message->getTemplate($this), |
|
| 42 | json_encode($message->getData($this)) |
||
| 43 | ); |
||
| 44 | |||
| 45 | 1 | $file = $this->config->get('file', ini_get('error_log')); |
|
| 46 | 1 | $status = error_log($message, 3, $file); |
|
| 47 | 1 | ||
| 48 | 1 | return compact('status', 'file'); |
|
| 49 | 1 | } |
|
| 50 | } |
||
| 51 |