Completed
Push — master ( 7ab1ca...c15062 )
by Simon
06:15 queued 05:12
created

CouldNotSendNotification::serviceRespondedWithAnError()   A

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
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace SimonKub\Laravel\Notifications\Sipgate\Exceptions;
4
5
use Exception;
6
use Throwable;
7
8
class CouldNotSendNotification extends Exception
9
{
10
    public static function noRecipient()
11
    {
12
        return new static('Could not find recipient for notification');
13
    }
14
15
    public static function noSmsId()
16
    {
17
        return new static('Could not find SmsId');
18
    }
19
20
    public static function connectionFailed(Throwable $exception)
21
    {
22
        return new static(
23
            "Could not connect to sipgate: {$exception->getCode()}: {$exception->getMessage()}"
24
        );
25
    }
26
}
27