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

SummaryRisk::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
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 SummaryRisk implements ApiResponse
17
{
18
    /**
19
     * @var int
20
     */
21
    private $high = 0;
22
23
    /**
24
     * @var int
25
     */
26
    private $low = 0;
27
28
    /**
29
     * @var int
30
     */
31
    private $medium = 0;
32
33
    /**
34
     * @var int
35
     */
36
    private $unknown = 0;
37
38 8
    public static function create(array $data): self
39
    {
40 8
        $model = new self();
41
42 8
        $model->high = $data['high'] ?? 0;
43 8
        $model->low = $data['low'] ?? 0;
44 8
        $model->medium = $data['medium'] ?? 0;
45 8
        $model->unknown = $data['unknown'] ?? 0;
46
47 8
        return $model;
48
    }
49
50 8
    private function __construct()
51
    {
52 8
    }
53
54 1
    public function getHigh(): int
55
    {
56 1
        return $this->high;
57
    }
58
59 1
    public function getLow(): int
60
    {
61 1
        return $this->low;
62
    }
63
64 1
    public function getMedium(): int
65
    {
66 1
        return $this->medium;
67
    }
68
69 1
    public function getUnknown(): int
70
    {
71 1
        return $this->unknown;
72
    }
73
}
74