Conditions | 4 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4.0119 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | 6 | public function toArray() |
|
47 | { |
||
48 | $data = [ |
||
49 | 6 | 'user_id' => config('notify-lk.credentials.user_id'), |
|
50 | 6 | 'api_key' => config('notify-lk.credentials.api_key'), |
|
51 | 6 | 'sender_id' => $this->sender ?: config('notify-lk.default_sender_id'), |
|
52 | 6 | 'message' => $this->content, |
|
53 | 6 | 'to' => $this->to, |
|
54 | ]; |
||
55 | |||
56 | 6 | if ($this->isUnicode) { |
|
57 | $data['type'] = 'unicode'; |
||
58 | } |
||
59 | |||
60 | 6 | if ($this->contact !== null) { |
|
61 | 3 | $data = array_merge($data, $this->contact->toArray()); |
|
62 | } |
||
63 | |||
64 | 6 | return $data; |
|
65 | } |
||
67 |