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

SummaryResult::getUndeliverable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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