Completed
Push — master ( 43a76d...75ce5f )
by David
01:41
created

SummaryResult   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 0
dl 0
loc 68
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 1
A __construct() 0 3 1
A getDeliverable() 0 4 1
A getDoNotSend() 0 4 1
A getUndeliverable() 0 4 1
A getCatchAll() 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\EmailValidationV4;
13
14
use Mailgun\Model\ApiResponse;
15
16
final class SummaryResult implements ApiResponse
17
{
18
    /**
19
     * @var int
20
     */
21
    private $deliverable = 0;
22
23
    /**
24
     * @var int
25
     */
26
    private $doNotSend = 0;
27
28
    /**
29
     * @var int
30
     */
31
    private $undeliverable = 0;
32
33
    /**
34
     * @var int
35
     */
36
    private $catchAll = 0;
37
38
    /**
39
     * @var int
40
     */
41
    private $unknown = 0;
42
43 8
    public static function create(array $data): self
44
    {
45 8
        $model = new self();
46 8
        $model->deliverable = $data['deliverable'] ?? 0;
47 8
        $model->doNotSend = $data['do_not_send'] ?? 0;
48 8
        $model->undeliverable = $data['undeliverable'] ?? 0;
49 8
        $model->catchAll = $data['catch_all'] ?? 0;
50 8
        $model->unknown = $data['unknown'] ?? 0;
51
52 8
        return $model;
53
    }
54
55 8
    private function __construct()
56
    {
57 8
    }
58
59 1
    public function getDeliverable(): int
60
    {
61 1
        return $this->deliverable;
62
    }
63
64 1
    public function getDoNotSend(): int
65
    {
66 1
        return $this->doNotSend;
67
    }
68
69 1
    public function getUndeliverable(): int
70
    {
71 1
        return $this->undeliverable;
72
    }
73
74 1
    public function getCatchAll(): int
75
    {
76 1
        return $this->catchAll;
77
    }
78
79 1
    public function getUnknown(): int
80
    {
81 1
        return $this->unknown;
82
    }
83
}
84