| 1 | <?php |
||
| 8 | class SmscRuChannel |
||
| 9 | { |
||
| 10 | /** @var \NotificationChannels\SmscRu\SmscRuApi */ |
||
| 11 | protected $smsc; |
||
| 12 | |||
| 13 | public function __construct(SmscRuApi $smsc) |
||
| 14 | { |
||
| 15 | $this->smsc = $smsc; |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Send the given notification. |
||
| 20 | * |
||
| 21 | * @param mixed $notifiable |
||
| 22 | * @param \Illuminate\Notifications\Notification $notification |
||
| 23 | * |
||
| 24 | * @throws \NotificationChannels\SmscRu\Exceptions\CouldNotSendNotification |
||
| 25 | */ |
||
| 26 | public function send($notifiable, Notification $notification) |
||
| 27 | { |
||
| 28 | $to = $notifiable->routeNotificationFor('smscru'); |
||
| 29 | |||
| 30 | if (empty($to)) { |
||
| 31 | throw CouldNotSendNotification::missingRecipient(); |
||
| 32 | } |
||
| 33 | |||
| 34 | $message = $notification->toSmscRu($notifiable); |
||
|
|
|||
| 35 | |||
| 36 | if (is_string($message)) { |
||
| 37 | $message = new SmscRuMessage($message); |
||
| 38 | } |
||
| 39 | |||
| 40 | $this->sendMessage($to, $message); |
||
| 41 | } |
||
| 42 | |||
| 43 | protected function sendMessage($recipient, SmscRuMessage $message) |
||
| 61 | } |
||
| 62 |
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.