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 (#14)
by Casper
02:36
created

CouldNotSendNotification   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A invalidMessageObject() 0 6 2
A missingFrom() 0 4 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("Notification was not sent. Message object class `{$className}` is invalid. It should be either `".SmsMessage::class.'` or `'.CallMessage::class.'`');
20
    }
21
22
    /**
23
     * @return static
24
     */
25 1
    public static function missingFrom()
26
    {
27 1
        return new static('Notification was not sent. Missing `from` number.');
28
    }
29
}
30