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 ( a45d5b...8da4ae )
by Gregorio
07:07
created

CouldNotSendNotification   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 76.92%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 42
ccs 10
cts 13
cp 0.7692
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidMessageObject() 0 8 2
A missingFrom() 0 4 1
A invalidReceiver() 0 7 1
A missingAlphaNumericSender() 0 6 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
            method or a phone_number attribute to your notifiable.'
40 1
        );
41
    }
42
43
    public static function missingAlphaNumericSender()
44
    {
45
        return new static(
46
            'Notification was not sent. Missing `alphanumeric_sender` in config'
47
        );
48
    }
49
}
50