laravel-notification-channels /
sms-broadcast
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace NotificationChannels\SmsBroadcast; |
||||||
| 4 | |||||||
| 5 | use Atymic\SmsBroadcast\Api\Client; |
||||||
| 6 | use Illuminate\Notifications\Notification; |
||||||
| 7 | |||||||
| 8 | class SmsBroadcastChannel |
||||||
| 9 | { |
||||||
| 10 | /** @var Client */ |
||||||
| 11 | private $smsBroadcastClient; |
||||||
| 12 | |||||||
| 13 | public function __construct(Client $smsBroadcastClient) |
||||||
| 14 | { |
||||||
| 15 | $this->smsBroadcastClient = $smsBroadcastClient; |
||||||
| 16 | } |
||||||
| 17 | |||||||
| 18 | public function send($notifiable, Notification $notification): void |
||||||
| 19 | { |
||||||
| 20 | if (! $to = $notifiable->routeNotificationFor('smsbroadcast')) { |
||||||
| 21 | return; |
||||||
| 22 | } |
||||||
| 23 | |||||||
| 24 | $message = $notification->toSmsBroadcast($notifiable); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 25 | |||||||
| 26 | if (is_string($message)) { |
||||||
| 27 | $message = new SmsBroadcastMessage($message); |
||||||
| 28 | } |
||||||
| 29 | |||||||
| 30 | if (! $message instanceof SmsBroadcastMessage) { |
||||||
| 31 | return; |
||||||
| 32 | } |
||||||
| 33 | |||||||
| 34 | try { |
||||||
| 35 | $this->smsBroadcastClient->send( |
||||||
| 36 | $to, |
||||||
| 37 | $message->content, |
||||||
| 38 | $message->sender, |
||||||
| 39 | $message->reference, |
||||||
| 40 | true, |
||||||
| 41 | $message->delay |
||||||
| 42 | ); |
||||||
| 43 | } catch (\Exception $e) { |
||||||
| 44 | report($e); |
||||||
|
0 ignored issues
–
show
The function
report was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 45 | |||||||
| 46 | return; |
||||||
| 47 | } |
||||||
| 48 | } |
||||||
| 49 | } |
||||||
| 50 |
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.