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 ( 67f588...9165e2 )
by Peter
08:09
created

MessagebirdChannel::send()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 14
ccs 10
cts 10
cp 1
rs 9.4285
c 1
b 0
f 0
cc 3
eloc 7
nc 4
nop 2
crap 3
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 3
    public function __construct(MessagebirdClient $client)
13
    {
14 3
        $this->client = $client;
15 3
    }
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 2
    public function send($notifiable, Notification $notification)
26
    {
27 2
        $message = $notification->toMessagebird($notifiable);
28
29 2
        if (is_string($message)) {
30 1
            $message = MessagebirdMessage::create($message);
31 1
        }
32
33 2
        if ($to = $notifiable->routeNotificationFor('messagebird')) {
34 2
            $message->setRecipients($to);
35 2
        }
36
37 2
        $this->client->send($message);
38 2
    }
39
}
40