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 ( 0bf2c9...433085 )
by Jhao
01:34
created

smscRespondedWithAnError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 6
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
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 content length is greater than 800 characters.
12
     *
13
     * @return static
14
     */
15
    public static function contentLengthLimitExceeded()
16
    {
17
        return new static(
18
            'Notification was not sent. Content length may not be greater than 800 characters.'
19
        );
20
    }
21
22
    /**
23
     * Thrown when we're unable to communicate with smsc.ru.
24
     *
25
     * @param  DomainException  $exception
26
     *
27
     * @return static
28
     */
29
    public static function smscRespondedWithAnError(DomainException $exception)
30
    {
31
        return new static(
32
            "smsc.ru responded with an error '{$exception->getCode()}: {$exception->getMessage()}'"
33
        );
34
    }
35
36
    /**
37
     * Thrown when we're unable to communicate with smsc.ru.
38
     *
39
     * @param  Exception  $exception
40
     *
41
     * @return static
42
     */
43
    public static function couldNotCommunicateWithSmsc(Exception $exception)
44
    {
45
        return new static("The communication with smsc.ru failed. Reason: {$exception->getMessage()}");
46
    }
47
}
48