CouldNotSendNotification::apiFailed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Author: Facundo J Gonzalez
4
 * Date: 17/11/2017.
5
 */
6
7
namespace NotificationChannels\SMSC\Exceptions;
8
9
/**
10
 * Class CouldNotSendNotification.
11
 */
12
class CouldNotSendNotification extends \Exception
13
{
14
    /**
15
     * Get a new could not send notification exception with
16
     * length error message.
17
     *
18
     * @return static
19
     */
20
    public static function contentLengthLimitExceeded()
21
    {
22
        $message = 'The content length is too long for an sms message.';
23
24
        return new static($message);
25
    }
26
27
    /**
28
     * Get a new could not send notification exception with
29
     * missing recipient message.
30
     *
31
     * @return static
32
     */
33
    public static function missingRecipient()
34
    {
35
        $message = 'The recipient of the sms message is missing.';
36
37
        return new static($message);
38
    }
39
40
    /**
41
     * Get a new could not send notification exception with
42
     * missing Recipient message.
43
     *
44
     * @param  string $message
45
     * @return static
46
     */
47
    public static function apiFailed($message)
48
    {
49
        return new static($message);
50
    }
51
}
52