Issues (15)

src/SmsirChannel.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Rezahmady\Smsir;
4
5
use Rezahmady\Smsir\Exceptions\CouldNotSendNotification;
6
use Illuminate\Notifications\Notification;
7
use Illuminate\Support\Facades\Log;
8
use Rezahmady\Smsir\Facades\Smsir;
9
10
class SmsirChannel
11
{
12
13
    public function __construct()
14
    {
15
        // Initialisation code here
16
    }
17
18
    /**
19
     * Send the given notification.
20
     *
21
     * @param mixed $notifiable
22
     * @param \Illuminate\Notifications\Notification $notification
23
     *
24
     * @throws \Rezahmady\Smsir\Exceptions\CouldNotSendNotification
25
     */
26
    public function send($notifiable, Notification $notification)
27
    {
28
29
        if(! $to = $notifiable->routeNotificationFor('smsir')) {
30
            return;
31
        }
32
        
33
        $message = $notification->toSmsir($notifiable);
0 ignored issues
show
The method toSmsir() does not exist on Illuminate\Notifications\Notification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        /** @scrutinizer ignore-call */ 
34
        $message = $notification->toSmsir($notifiable);

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.

Loading history...
34
35
        return $message->setTo($to)->trigger();
36
    }
37
}
38