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
Pull Request — master (#17)
by Casper
16:13 queued 14:17
created

CouldNotSendNotification   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 4
c 5
b 0
f 1
lcom 1
cbo 0
dl 0
loc 35
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidMessageObject() 0 8 2
A missingFrom() 0 4 1
A invalidReceiver() 0 7 1
1
<?php
2
3
namespace NotificationChannels\Twilio\Exceptions;
4
5
use NotificationChannels\Twilio\CallMessage;
6
use NotificationChannels\Twilio\SmsMessage;
7
8
class CouldNotSendNotification extends \Exception
9
{
10
    /**
11
     * @param mixed $message
12
     *
13
     * @return static
14
     */
15 2
    public static function invalidMessageObject($message)
16
    {
17 2
        $className = get_class($message) ?: 'Unknown';
18
19 1
        return new static(
20 1
            "Notification was not sent. Message object class `{$className}` is invalid. It should
21 1
            be either `".SmsMessage::class.'` or `'.CallMessage::class.'`');
22
    }
23
24
    /**
25
     * @return static
26
     */
27 1
    public static function missingFrom()
28
    {
29 1
        return new static('Notification was not sent. Missing `from` number.');
30
    }
31
32
    /**
33
     * @return static
34
     */
35 1
    public static function invalidReceiver()
36
    {
37 1
        return new static(
38
            'The notifiable did not have a receiving phone number. Add a routeNotificationForTwilio
39 1
            method or a phone_number attribute to your notifiable.'
40
        );
41
    }
42
}
43