CouldNotSendNotification   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A serviceRespondedWithAnError() 0 4 1
A apiKeyNotProvided() 0 4 1
A serviceNotAvailable() 0 4 1
A phoneNumberNotProvided() 0 4 1
1
<?php
2
3
namespace NotificationChannels\SMS77\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7
    public static function serviceRespondedWithAnError($message)
8
    {
9
        return new static('SMS77 Response: '.$message);
10
    }
11
12
    public static function apiKeyNotProvided(): self
13
    {
14
        return new static('API key is missing.');
15
    }
16
17
    public static function serviceNotAvailable($message): self
18
    {
19
        return new static($message);
20
    }
21
22
    public static function phoneNumberNotProvided(): self
23
    {
24
        return new static('No phone number was provided.');
25
    }
26
}
27