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.

CouldNotSendNotification   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
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 31
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
declare(strict_types=1);
4
5
namespace NotificationChannels\Twilio\Exceptions;
6
7
use NotificationChannels\Twilio\TwilioCallMessage;
8
use NotificationChannels\Twilio\TwilioSmsMessage;
9
10
class CouldNotSendNotification extends \Exception
11
{
12 2
    public static function invalidMessageObject($message): self
13
    {
14 2
        $className = is_object($message) ? get_class($message) : 'Unknown';
15
16 2
        return new static(
17 2
            "Notification was not sent. Message object class `{$className}` is invalid. It should
18 2
            be either `".TwilioSmsMessage::class.'` or `'.TwilioCallMessage::class.'`');
19
    }
20
21 1
    public static function missingFrom(): self
22
    {
23 1
        return new static('Notification was not sent. Missing `from` number.');
24
    }
25
26 1
    public static function invalidReceiver(): self
27
    {
28 1
        return new static(
29 1
            'The notifiable did not have a receiving phone number. Add a routeNotificationForTwilio
30
            method or a phone_number attribute to your notifiable.'
31
        );
32
    }
33
34
    public static function missingAlphaNumericSender(): self
35
    {
36
        return new static(
37
            'Notification was not sent. Missing `alphanumeric_sender` in config'
38
        );
39
    }
40
}
41