Completed
Push — master ( 6fa888...1dfddd )
by Patrick
02:15
created

DeliveryStatusNotification   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A from() 0 6 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