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 ( 8cb94b...887a66 )
by Mohamed
01:58
created

ClickatellChannel::shouldSendMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace NotificationChannels\Clickatell;
4
5
use NotificationChannels\Clickatell\Exceptions\CouldNotSendNotification;
6
use Illuminate\Notifications\Notification;
7
8
class ClickatellChannel
9
{
10
    /** @var ClickatellClient */
11
    protected $clickatell;
12
13
    /**
14
     * @param ClickatellClient $clickatell
15
     */
16
    public function __construct(ClickatellClient $clickatell)
17
    {
18
        $this->clickatell = $clickatell;
19
    }
20
21
    /**
22
     * Send the given notification.
23
     *
24
     * @param mixed $notifiable
25
     * @param Notification $notification
26
     *
27
     * @throws CouldNotSendNotification
28
     */
29
    public function send($notifiable, Notification $notification)
30
    {
31
        if (! $to = $notifiable->routeNotificationFor('clickatell')) {
32
            return;
33
        }
34
35
        $message = $notification->toClickatell($notifiable);
36
37
        if (is_string($message)) {
38
            $message = new ClickatellMessage($message);
39
        }
40
41
        $this->clickatell->send($to, $message->getContent());
42
    }
43
}
44