CouldNotSendNotification   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A serviceRespondedWithAnError() 0 6 3
1
<?php
2
3
namespace Andreshg112\PusherApiNotifications\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7 1
    public static function serviceRespondedWithAnError($response)
8
    {
9 1
        $encodedResponse = is_string($response) || is_bool($response)
10 1
            ? $response : json_encode($response);
11
12 1
        return new static("Message could not be sent: $encodedResponse");
13
    }
14
}
15