ActTransferMoneyResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getError() 0 3 1
A getActs() 0 3 1
A getIterator() 0 3 1
A getErrorMsg() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Responses\Act\TransferMoney;
6
7
use DalliSDK\Models\StickerOrder;
8
use DalliSDK\Models\TransferMoneyAct;
9
use DalliSDK\Responses\ResponseInterface;
10
use JMS\Serializer\Annotation as JMS;
11
12
/**
13
 * Сюда мапится ответ на запрос получение актов передачи денег
14
 *
15
 * @see https://api.dalli-service.com/v1/doc/moneyTransfers
16
 *
17
 * @JMS\XmlRoot("moneyTransfers")
18
 *
19
 * @template-implements \IteratorAggregate<int, TransferMoneyAct>
20
 */
21
class ActTransferMoneyResponse implements ResponseInterface, \IteratorAggregate
22
{
23
    /**
24
     * @JMS\Type("array<DalliSDK\Models\TransferMoneyAct>")
25
     * @JMS\XmlList(inline = true, entry = "act")
26
     * @var TransferMoneyAct[]
27
     */
28
    private array $items = [];
29
30
    /**
31
     * Код ошибки
32
     *
33
     * @JMS\XmlAttribute()
34
     * @JMS\Type("int")
35
     */
36
    private ?int $error = null;
37
38
    /**
39
     * Текст ошибки
40
     *
41
     * @JMS\XmlAttribute()
42
     * @JMS\Type("string")
43
     * @JMS\SerializedName("errormsg")
44
     */
45
    private ?string $errorMsg = null;
46
47
    /**
48
     * @return \Traversable|TransferMoneyAct[]
49
     */
50 1
    public function getIterator(): \ArrayIterator
51
    {
52 1
        return new \ArrayIterator($this->getActs());
53
    }
54
55
    /**
56
     * @return TransferMoneyAct[]
57
     */
58 2
    public function getActs(): array
59
    {
60 2
        return $this->items;
61
    }
62
63
    /**
64
     * @return int|null
65
     */
66 1
    public function getError(): ?int
67
    {
68 1
        return $this->error;
69
    }
70
71
    /**
72
     * @return string|null
73
     */
74 1
    public function getErrorMsg(): ?string
75
    {
76 1
        return $this->errorMsg;
77
    }
78
}
79