Completed
Push — master ( d834aa...40bc03 )
by antikainen
01:56
created

serviceRespondedWithAnError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace NotificationChannels\ZonerSmsGateway\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7 1
    public static function serviceRespondedWithAnError($code)
8
    {
9 1
        return new static("Zoner SMS-Gateway returned error code $code", $code);
10
    }
11
12
    public static function unexpectedHttpStatus($response)
13
    {
14
        return new static('Zoner SMS-Gateway returned HTTP status '.$response->getStatusCode());
15
    }
16
17
    public static function usernameNotProvided()
18
    {
19
        return new static('You must provide your Zoner SMS-Gateway username to make any API requests.');
20
    }
21
22
    public static function receiverNotProvided()
23
    {
24
        return new static('Receiver number not defined.');
25
    }
26
27
    public static function senderNotProvided()
28
    {
29
        return new static('Sender number not defined.');
30
    }
31
32
    public static function emptyMessage()
33
    {
34
        return new static('Message is empty.');
35
    }
36
}
37