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

IndexResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
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\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