GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( efdcd2...9e411c )
by Peter
12:33
created

MessagebirdChannel::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\Messagebird;
4
5
use Illuminate\Notifications\Notification;
6
7
class MessagebirdChannel
8
{
9
    /** @var \NotificationChannels\Messagebird\MessagebirdClient */
10
    protected $client;
11
12
    public function __construct(MessagebirdClient $client)
13
    {
14
        $this->client = $client;
15
    }
16
17
    /**
18
     * Send the given notification.
19
     *
20
     * @param mixed $notifiable
21
     * @param \Illuminate\Notifications\Notification $notification
22
     *
23
     * @throws \NotificationChannels\MessageBird\Exceptions\CouldNotSendNotification
24
     */
25
    public function send($notifiable, Notification $notification)
26
    {
27
        $message = $notification->toMessagebird($notifiable);
0 ignored issues
show
Bug introduced by
The method toMessagebird() does not seem to exist on object<Illuminate\Notifications\Notification>.

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...
28
29
        if (is_string($message)) {
30
            $message = MessagebirdMessage::create($message);
31
        }
32
33
        if ($to = $notifiable->routeNotificationFor('messagebird')) {
34
            $message->setRecipients($to);
35
        }
36
37
        $this->client->send($message);
38
    }
39
}
40