squareetlabs /
LaravelSmsUp
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace SquareetLabs\LaravelSmsUp; |
||||||
| 4 | |||||||
| 5 | use Illuminate\Support\Facades\Event; |
||||||
| 6 | use SquareetLabs\LaravelSmsUp\Events\SmsUpMessageWasSent; |
||||||
| 7 | use SquareetLabs\LaravelSmsUp\Exceptions\CouldNotSendNotification; |
||||||
| 8 | use Illuminate\Notifications\Notification; |
||||||
| 9 | use SquareetLabs\LaravelSmsUp\Facades; |
||||||
| 10 | |||||||
| 11 | /** |
||||||
| 12 | * Class SmsUpChannel |
||||||
| 13 | * @package SquareetLabs\LaravelSmsUp |
||||||
| 14 | */ |
||||||
| 15 | class SmsUpChannel |
||||||
| 16 | { |
||||||
| 17 | /** |
||||||
| 18 | * SmsUpChannel constructor. |
||||||
| 19 | */ |
||||||
| 20 | public function __construct() |
||||||
| 21 | { |
||||||
| 22 | } |
||||||
| 23 | |||||||
| 24 | /** |
||||||
| 25 | * @param $notifiable |
||||||
| 26 | * @param Notification $notification |
||||||
| 27 | * @throws CouldNotSendNotification |
||||||
| 28 | */ |
||||||
| 29 | public function send($notifiable, Notification $notification) |
||||||
| 30 | { |
||||||
| 31 | /** @var SmsUpMessage $message */ |
||||||
| 32 | $message = $notification->toSmsUp($notifiable); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 33 | |||||||
| 34 | if (empty($message->getTo())) { |
||||||
| 35 | if (!$to = $notifiable->routeNotificationFor('smsUp')) { |
||||||
| 36 | throw CouldNotSendNotification::missingRecipient(); |
||||||
| 37 | } |
||||||
| 38 | $message->to($to); |
||||||
| 39 | } |
||||||
| 40 | |||||||
| 41 | $messages = [ |
||||||
| 42 | $message->formatData() |
||||||
| 43 | ]; |
||||||
| 44 | $response = Facades\SmsUp::sendMessages($messages); |
||||||
|
0 ignored issues
–
show
The method
sendMessages() does not exist on SquareetLabs\LaravelSmsUp\Facades\SmsUp. Since you implemented __callStatic, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 45 | |||||||
| 46 | $responseArray = []; |
||||||
| 47 | array_push($responseArray, json_decode($response->getBody(), true)); |
||||||
| 48 | $reponseMessage = new SmsUpResponse($responseArray[0]); |
||||||
| 49 | |||||||
| 50 | Event::dispatch(new SmsUpMessageWasSent($message, $reponseMessage)); |
||||||
| 51 | } |
||||||
| 52 | } |
||||||
| 53 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.