Passed
Push — master ( 5e2a38...990aad )
by Andrés
03:46
created

serviceRespondedWithAnError()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 3
nc 4
nop 1
1
<?php
2
3
namespace Andreshg112\PusherApiNotifications\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7
    public static function serviceRespondedWithAnError($response)
8
    {
9
        $encodedResponse = is_string($response) || is_bool($response)
10
            ? $response : json_encode($response);
11
12
        return new static("Message could not be sent: $encodedResponse");
13
    }
14
}
15