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

DeleteResponse::getError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
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