PointResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 23
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 3 1
A getItems() 0 3 1
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