Test Failed
Pull Request — master (#2)
by Talha Zekeriya
19:57 queued 09:46
created

CouldNotSendNotification::unknownError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace NotificationChannels\NetGsm\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7
    public static function serviceRespondedWithAnError(\Exception $exception)
8
    {
9
        return new static("NetGsm service responded with an error '{$exception->getCode()}: {$exception->getMessage()}'");
10
    }
11
12
    public static function emptyRecipients()
13
    {
14
        return new static('In order to send notification via NetGsm you need to add some recipients.');
15
    }
16
17
    public static function invalidResponse()
18
    {
19
        return new static('Invalid response from NetGSM server.');
20
    }
21
22
    public static function invalidMessageContent()
23
    {
24
        return new static('Invalid message content.');
25
    }
26
27
    public static function invalidHeader()
28
    {
29
        return new static('Invalid message header.');
30
    }
31
32
    public static function invalidRequest()
33
    {
34
        return new static('Invalid request.');
35
    }
36
37
    public static function unknownError()
38
    {
39
        return new static('Unknown Error.');
40
    }
41
}
42