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

CreateResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 9 1
A getType() 0 4 1
A getValue() 0 4 1
A getMessage() 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\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