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

IndexResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A create() 0 8 1
A getItems() 0 4 1
A getTotalCount() 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 IndexResponse implements ApiResponse
18
{
19
    /**
20
     * @var string[]
21
     */
22
    private $items;
23
24
    /**
25
     * @var int
26
     */
27
    private $totalCount = 0;
28
29 1
    private function __construct()
30
    {
31 1
    }
32
33 1
    public static function create(array $data)
34
    {
35 1
        $model = new self();
36 1
        $model->items = $data['items'];
37 1
        $model->totalCount = $data['total_count'];
38
39 1
        return $model;
40
    }
41
42
    /**
43
     * @return string[]
44
     */
45 1
    public function getItems()
46
    {
47 1
        return $this->items;
48
    }
49
50
    /**
51
     * @return int
52
     */
53 1
    public function getTotalCount()
54
    {
55 1
        return $this->totalCount;
56
    }
57
}
58