Completed
Push — master ( 1fd018...1044a6 )
by David
20:21
created

CreateResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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\Suppression\Whitelist;
13
14
use Mailgun\Model\ApiResponse;
15
16
/**
17
 * @author Artem Bondarenko <[email protected]>
18
 */
19
final class CreateResponse implements ApiResponse
20
{
21
    private $type;
22
    private $value;
23
    private $message;
24
25
    final private function __construct()
26
    {
27
    }
28
29
    public static function create(array $data): self
30
    {
31
        $model = new static();
32
        $model->type = $data['type'] ?? '';
33
        $model->value = $data['value'] ?? '';
34
        $model->message = $data['message'] ?? '';
35
36
        return $model;
37
    }
38
39
    public function getType(): string
40
    {
41
        return $this->type;
42
    }
43
44
    public function getValue(): string
45
    {
46
        return $this->value;
47
    }
48
49
    public function getMessage(): string
50
    {
51
        return $this->message;
52
    }
53
}
54