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

CouldNotSendNotification   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 19
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A noRecipient() 0 4 1
A noSmsId() 0 4 1
A connectionFailed() 0 6 1
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