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

ValidationStatusSummary::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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\MailingList;
13
14
use Mailgun\Model\ApiResponse;
15
16
final class ValidationStatusSummary implements ApiResponse
17
{
18
    private $result;
19
    private $risk;
20
21 2
    public static function create(array $data): self
22
    {
23 2
        $model = new self();
24 2
        $model->result = ValidationStatusSummaryResult::create($data['result'] ?? []);
25 2
        $model->risk = ValidationStatusSummaryRisk::create($data['risk'] ?? []);
26
27 2
        return $model;
28
    }
29
30 2
    private function __construct()
31
    {
32 2
    }
33
34 2
    public function getResult(): ValidationStatusSummaryResult
35
    {
36 2
        return $this->result;
37
    }
38
39 2
    public function getRisk(): ValidationStatusSummaryRisk
40
    {
41 2
        return $this->risk;
42
    }
43
}
44