Completed
Push — master ( c0a386...56655a )
by Tobias
06:16 queued 03:48
created

ShowResponse   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 55
ccs 14
cts 14
cp 1
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 getIp() 0 4 1
A getDedicated() 0 4 1
A getRdns() 0 4 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\Ip;
11
12
use Mailgun\Model\ApiResponse;
13
14
/**
15
 * @author Tobias Nyholm <[email protected]>
16
 */
17
final class ShowResponse implements ApiResponse
18
{
19
    /**
20
     * @var string
21
     */
22
    private $ip;
23
24
    /**
25
     * @var bool
26
     */
27
    private $dedicated;
28
29
    /**
30
     * @var string
31
     */
32
    private $rdns;
33
34 1
    private function __construct()
35
    {
36 1
    }
37
38 1
    public static function create(array $data)
39
    {
40 1
        $model = new self();
41 1
        $model->ip = $data['ip'];
42 1
        $model->dedicated = (bool) $data['dedicated'];
43 1
        $model->rdns = $data['rdns'];
44
45 1
        return $model;
46
    }
47
48
    /**
49
     * @return string
50
     */
51 1
    public function getIp()
52
    {
53 1
        return $this->ip;
54
    }
55
56
    /**
57
     * @return bool
58
     */
59 1
    public function getDedicated()
60
    {
61 1
        return $this->dedicated;
62
    }
63
64
    /**
65
     * @return string
66
     */
67 1
    public function getRdns()
68
    {
69 1
        return $this->rdns;
70
    }
71
}
72