Completed
Push — master ( 4b0611...da5ccd )
by Tobias
06:14 queued 03:25
created

DeleteResponse::getAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
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
/*
4
 * Copyright (C) 2013 Mailgun
5
 *
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Mailgun\Model\MailingList;
11
12
use Mailgun\Model\ApiResponse;
13
14 View Code Duplication
final class DeleteResponse implements ApiResponse
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * @var string
18
     */
19
    private $message;
20
21
    /**
22
     * @var string
23
     */
24
    private $address;
25
26 1
    public static function create(array $data)
27
    {
28 1
        $message = isset($data['message']) ? $data['message'] : '';
29 1
        $address = isset($data['address']) ? $data['address'] : '';
30
31 1
        return new self($address, $message);
32
    }
33
34
    /**
35
     * DeleteResponse constructor.
36
     *
37
     * @param string $address
38
     * @param string $message
39
     */
40 1
    private function __construct($address, $message)
41
    {
42 1
        $this->address = $address;
43 1
        $this->message = $message;
44 1
    }
45
46
    /**
47
     * @return string
48
     */
49 1
    public function getMessage()
50
    {
51 1
        return $this->message;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getAddress()
58
    {
59 1
        return $this->address;
60
    }
61
}
62