Passed
Push — main ( 6bf038...578b82 )
by Aleksandr
03:45 queued 32s
created

DeliveryPrice::getAdvPrices()   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 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\Models;
6
7
use DalliSDK\Traits\Fillable;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Модель для контейнера стоимости доставки
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/request-delivery-status
14
 * @see \DalliSDK\Models\AdvPrice
15
 * @JMS\XmlRoot("deliveryprice")
16
 *
17
 * @template-implements \IteratorAggregate<mixed, AdvPrice>
18
 */
19
class DeliveryPrice implements \IteratorAggregate
20
{
21
    use Fillable;
22
23
    /**
24
     * @JMS\XmlAttribute()
25
     * @JMS\Type("float")
26
     */
27
    private float $total;
28
29
    /**
30
     * @JMS\Type("array<DalliSDK\Models\AdvPrice>")
31
     * @JMS\XmlList(inline = true, entry = "advprice")
32
     * @var AdvPrice[]
33
     */
34
    private array $advPrices;
35
36
    /**
37
     * @return float
38
     */
39 2
    public function getTotal(): float
40
    {
41 2
        return $this->total;
42
    }
43
44
    /**
45
     * @return AdvPrice[]
46
     */
47 2
    public function getAdvPrices(): array
48
    {
49 2
        return $this->advPrices;
50
    }
51
52
    /**
53
     * @return \Traversable|AdvPrice[]
54
     */
55 1
    public function getIterator(): \ArrayIterator
56
    {
57 1
        return new \ArrayIterator($this->getAdvPrices());
58
    }
59
}
60