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 ( e92d25...a22394 )
by Jhao
02:03
created

CouldNotSendNotification::missingRecipient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\SmscRu\Exceptions;
4
5
use Exception;
6
use DomainException;
7
8
class CouldNotSendNotification extends Exception
9
{
10
    /**
11
     * Thrown when recipient's phone number is missing.
12
     *
13
     * @return static
14
     */
15
    public static function missingRecipient()
16
    {
17
        return new static('Notification was not sent. Phone number is missing.');
18
    }
19
20
    /**
21
     * Thrown when content length is greater than 800 characters.
22
     *
23
     * @return static
24
     */
25
    public static function contentLengthLimitExceeded()
26
    {
27
        return new static(
28
            'Notification was not sent. Content length may not be greater than 800 characters.'
29
        );
30
    }
31
32
    /**
33
     * Thrown when we're unable to communicate with smsc.ru.
34
     *
35
     * @param  DomainException  $exception
36
     *
37
     * @return static
38
     */
39
    public static function smscRespondedWithAnError(DomainException $exception)
40
    {
41
        return new static(
42
            "smsc.ru responded with an error '{$exception->getCode()}: {$exception->getMessage()}'"
43
        );
44
    }
45
46
    /**
47
     * Thrown when we're unable to communicate with smsc.ru.
48
     *
49
     * @param  Exception  $exception
50
     *
51
     * @return static
52
     */
53
    public static function couldNotCommunicateWithSmsc(Exception $exception)
54
    {
55
        return new static("The communication with smsc.ru failed. Reason: {$exception->getMessage()}");
56
    }
57
}
58