serviceRespondedWithAnError()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\AwsPinpoint\Exceptions;
4
5
class CouldNotSendNotification extends \Exception
6
{
7
    public static function serviceRespondedWithAnError($exception)
8
    {
9
        $msg = sprintf(
10
            'AWS Pinpoint responded with an error \'%s: %s\'',
11
            $exception->getCode(),
12
            $exception->getMessage()
13
        );
14
15
        return new static($msg);
16
    }
17
}
18