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

GetBulkPreviewResponse::__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 GetBulkPreviewResponse implements ApiResponse
17
{
18
    /**
19
     * @var Preview
20
     */
21
    private $preview;
22
23 1
    private function __construct()
24
    {
25 1
    }
26
27 1
    public static function create(array $data): self
28
    {
29 1
        $model = new self();
30 1
        $model->preview = Preview::create($data['preview']);
31
32 1
        return $model;
33
    }
34
35 1
    public function getPreview(): Preview
36
    {
37 1
        return $this->preview;
38
    }
39
}
40