serviceRespondedWithAnError()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 4
nop 1
crap 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