Completed
Push — master ( 90028d...27d579 )
by David
03:16
created

IndexResponse::getAssignableToPools()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
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
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\Ip;
13
14
use Mailgun\Model\ApiResponse;
15
16
/**
17
 * @author Tobias Nyholm <[email protected]>
18
 */
19
final class IndexResponse implements ApiResponse
20
{
21
    /**
22
     * @var string[]
23
     */
24
    private $items;
25
26
    /**
27
     * @var int
28
     */
29
    private $totalCount;
30
31
    /**
32
     * @var string[]
33
     */
34
    private $assignableToPools;
35
36 2
    private function __construct()
37
    {
38 2
    }
39
40 2
    public static function create(array $data)
41
    {
42 2
        $model = new self();
43 2
        $model->items = $data['items'];
44 2
        $model->totalCount = $data['total_count'] ?? 0;
45 2
        $model->assignableToPools = $data['assignable_to_pools'];
46
47 2
        return $model;
48
    }
49
50
    /**
51
     * @return string[]
52
     */
53 1
    public function getItems(): array
54
    {
55 1
        return $this->items;
56
    }
57
58
    /**
59
     * @return string[]
60
     */
61 1
    public function getAssignableToPools(): array
62
    {
63 1
        return $this->assignableToPools;
64
    }
65
66 1
    public function getTotalCount(): int
67
    {
68 1
        return $this->totalCount;
69
    }
70
}
71