Passed
Push — main ( 098d60...1e91ce )
by Aleksandr
09:01
created

TransferReturnAct::geActDate()   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 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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/returnTransfers
14
 *
15
 * @JMS\XmlRoot("act")
16
 *
17
 * @template-implements \IteratorAggregate<int, OrderTransferReturn>
18
 */
19
class TransferReturnAct implements \IteratorAggregate
20
{
21
    use Fillable;
22
23
    /**
24
     * Номер акта
25
     *
26
     * @JMS\XmlAttribute()
27
     * @JMS\Type("string")
28
     * @JMS\SerializedName("number")
29
     */
30
    private string $number;
31
32
    /**
33
     * Дата создания акта (Y-m-d)
34
     *
35
     * @JMS\XmlAttribute()
36
     * @JMS\Type("DateTimeImmutable<'Y-m-d'>")
37
     * @JMS\SerializedName("actDate")
38
     */
39
    private \DateTimeImmutable $actDate;
40
41
    /**
42
     * Комментарий к акту
43
     *
44
     * @JMS\XmlAttribute()
45
     * @JMS\Type("string")
46
     * @JMS\SerializedName("actMessage")
47
     */
48
    private ?string $actMessage = null;
49
50
    /**
51
     * @JMS\Type("array<DalliSDK\Models\OrderTransferReturn>")
52
     * @JMS\XmlList(inline = true, entry = "order")
53
     * @var OrderTransferReturn[]
54
     */
55
    private array $orders;
56
57
    /**
58
     * @return \Traversable|OrderTransferReturn[]
59
     */
60 1
    public function getIterator(): \ArrayIterator
61
    {
62 1
        return new \ArrayIterator($this->getOrders());
63
    }
64
65
    /**
66
     * @return OrderTransferReturn[]
67
     */
68 2
    public function getOrders(): array
69
    {
70 2
        return $this->orders;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 2
    public function getNumber(): string
77
    {
78 2
        return $this->number;
79
    }
80
81
    /**
82
     * @return null|string
83
     */
84 2
    public function getActMessage(): ?string
85
    {
86 2
        return $this->actMessage;
87
    }
88
89
    /**
90
     * @return \DateTimeImmutable
91
     */
92 2
    public function geActDate(): \DateTimeImmutable
93
    {
94 2
        return $this->actDate;
95
    }
96
}
97