Passed
Push — main ( ed4b4c...986270 )
by Aleksandr
09:15
created

FilialsResponse::getCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Responses;
6
7
use DalliSDK\Models\Filial;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Сюда мапится ответ на запрос списка ПВЗ
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/filials
14
 *
15
 * @JMS\XmlRoot("filials")
16
 *
17
 * @template-implements \IteratorAggregate<int, Filial>
18
 */
19
class FilialsResponse implements ResponseInterface, \IteratorAggregate
20
{
21
    /**
22
     * Количество филиалов
23
     *
24
     * @JMS\XmlAttribute()
25
     * @JMS\Type("int")
26
     */
27
    private int $count;
28
29
    /**
30
     * @JMS\Type("array<DalliSDK\Models\Filial>")
31
     * @JMS\XmlList(inline = true, entry = "filials")
32
     * @var Filial[]
33
     */
34
    private array $items = [];
35
36
    /**
37
     * @return \Traversable|Filial[]
38
     */
39 1
    public function getIterator(): \ArrayIterator
40
    {
41 1
        return new \ArrayIterator($this->getItems());
42
    }
43
44
    /**
45
     * @return Filial[]
46
     */
47 1
    public function getItems(): array
48
    {
49 1
        return $this->items;
50
    }
51
52
    /**
53
     * @return int
54
     */
55 1
    public function getCount(): int
56
    {
57 1
        return $this->count;
58
    }
59
}
60