PointResponse::getIterator()   A
last analyzed

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 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
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\Point;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Сюда мапится ответ на запрос списка ПВЗ
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/pointsInfo
14
 *
15
 * @JMS\XmlRoot("pvzlist")
16
 *
17
 * @template-implements \IteratorAggregate<int, Point>
18
 */
19
class PointResponse implements ResponseInterface, \IteratorAggregate
20
{
21
    /**
22
     * @JMS\Type("array<DalliSDK\Models\Point>")
23
     * @JMS\XmlList(inline = true, entry = "point")
24
     * @var Point[]
25
     */
26
    private array $items = [];
27
28
    /**
29
     * @return \Traversable|Point[]
30
     */
31 2
    public function getIterator(): \ArrayIterator
32
    {
33 2
        return new \ArrayIterator($this->getItems());
34
    }
35
36
    /**
37
     * @return Point[]
38
     */
39 2
    public function getItems(): array
40
    {
41 2
        return $this->items;
42
    }
43
}
44