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

SummaryRisk   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
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 58
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 11 1
A __construct() 0 3 1
A getHigh() 0 4 1
A getLow() 0 4 1
A getMedium() 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 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