Conditions | 6 |
Paths | 7 |
Total Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 12.4072 |
Changes | 0 |
1 | <?php |
||
43 | 3 | public function send($notifiable, Notification $notification) |
|
44 | { |
||
45 | 3 | if (! $to = $notifiable->routeNotificationFor('jusibe')) { |
|
46 | 1 | throw CouldNotSendNotification::missingTo(); |
|
47 | } |
||
48 | |||
49 | 2 | $message = $notification->toJusibe($notifiable); |
|
50 | |||
51 | 2 | if (is_string($message)) { |
|
52 | $message = new JusibeMessage($message); |
||
53 | } |
||
54 | |||
55 | 2 | if (! $from = $message->from ?: config('services.jusibe.sms_from')) { |
|
56 | 2 | throw CouldNotSendNotification::missingFrom(); |
|
57 | } |
||
58 | |||
59 | try { |
||
60 | $response = $this->jusibe->sendSMS([ |
||
61 | 'to' => $to, |
||
62 | 'from' => $from, |
||
63 | 'message' => trim($message->content), |
||
64 | ])->getResponse(); |
||
65 | |||
66 | return $response; |
||
67 | } catch (DomainException $exception) { |
||
68 | throw CouldNotSendNotification::serviceRespondedWithAnError($exception); |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..