Completed
Push — master ( 87c59d...6e372e )
by David
03:29 queued 01:52
created

ValidationStatusSummaryResult   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 42
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 10 1
A __construct() 0 3 1
A getDeliverable() 0 4 1
A getDoNotSend() 0 4 1
A getUndeliverable() 0 4 1
A getUnknown() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (C) 2013 Mailgun
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license. See the LICENSE file for details.
10
 */
11
12
namespace Mailgun\Model\MailingList;
13
14
use Mailgun\Model\ApiResponse;
15
16
final class ValidationStatusSummaryResult implements ApiResponse
17
{
18
    private $deliverable;
19
    private $doNotSend;
20
    private $undeliverable;
21
    private $unknown;
22
23 3
    public static function create(array $data): self
24
    {
25 3
        $model = new self();
26 3
        $model->deliverable = $data['deliverable'] ?? null;
27 3
        $model->doNotSend = $data['do_not_send'] ?? null;
28 3
        $model->undeliverable = $data['undeliverable'] ?? null;
29 3
        $model->unknown = $data['unknown'] ?? null;
30
31 3
        return $model;
32
    }
33
34 3
    private function __construct()
35
    {
36 3
    }
37
38 3
    public function getDeliverable(): ?int
39
    {
40 3
        return $this->deliverable;
41
    }
42
43 3
    public function getDoNotSend(): ?int
44
    {
45 3
        return $this->doNotSend;
46
    }
47
48 3
    public function getUndeliverable(): ?int
49
    {
50 3
        return $this->undeliverable;
51
    }
52
53 3
    public function getUnknown(): ?int
54
    {
55 3
        return $this->unknown;
56
    }
57
}
58