| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 22 | 2 | public function send($notifiable, Notification $notification) |
|
| 23 | { |
||
| 24 | 2 | $message = $notification->toJetSms($notifiable); |
|
| 25 | |||
| 26 | 2 | if ($message instanceof ShortMessage) { |
|
| 27 | JetSms::sendShortMessage($message); |
||
|
|
|||
| 28 | |||
| 29 | return; |
||
| 30 | } |
||
| 31 | |||
| 32 | 2 | $to = $notifiable->routeNotificationFor('JetSms'); |
|
| 33 | |||
| 34 | 2 | if (empty($to)) { |
|
| 35 | 1 | throw CouldNotSendNotification::missingRecipient(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 1 | JetSms::sendShortMessage($to, $message); |
|
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: