Completed
Push — master ( 3fbd33...51cff9 )
by David
02:08
created

DeleteResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 81.82%

Importance

Changes 0
Metric Value
dl 0
loc 28
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0
ccs 9
cts 11
cp 0.8182
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 8 1
A getMessage() 0 4 1
A getError() 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\Domain;
13
14
use Mailgun\Model\ApiResponse;
15
16
/**
17
 * @author Tobias Nyholm <[email protected]>
18
 */
19
final class DeleteResponse implements ApiResponse
20
{
21
    private $message;
22
    private $error;
23
24 1
    private function __construct()
25
    {
26 1
    }
27
28 1
    public static function create(array $data): self
29
    {
30 1
        $model = new self();
31 1
        $model->message = $data['message'] ?? null;
32 1
        $model->error = $data['error'] ?? null;
33
34 1
        return $model;
35
    }
36
37 1
    public function getMessage(): ?string
38
    {
39 1
        return $this->message;
40
    }
41
42
    public function getError(): ?string
43
    {
44
        return $this->error;
45
    }
46
}
47