DeliveryStatusNotification::from()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Artack\Dsn;
6
7
use Artack\Dsn\Exception\DsnException;
8
use Artack\Dsn\Parser\DsnParser;
9
10
/**
11
 * Idea: using a multipartparser to create dsn parsers per part.
12
 */
13
class DeliveryStatusNotification
14
{
15 2
    public static function from(string $content): DeliveryStatus
16
    {
17
        try {
18 2
            return (new DsnParser())->parse($content);
19 2
        } catch (\Exception $e) {
20 2
            throw new DsnException('Could not parse delivery status', 0, $e);
21
        }
22
    }
23
}
24