Passed
Push — main ( 15bc37...ad68f8 )
by Aleksandr
08:35
created

ActTransferMoneyRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Requests\Act\TransferMoney;
6
7
use DalliSDK\Requests\AbstractRequest;
8
use DalliSDK\Requests\RequestInterface;
9
use DalliSDK\Responses\Act\TransferMoney\ActTransferMoneyResponse;
10
use JMS\Serializer\Annotation as JMS;
11
12
/**
13
 * Запрос файла акта передачи денег
14
 *
15
 * @see https://api.dalli-service.com/v1/doc/moneyTransfers
16
 * @JMS\XmlRoot("moneyTransfers")
17
 */
18
class ActTransferMoneyRequest extends AbstractRequest implements RequestInterface
19
{
20
    public const RESPONSE_CLASS = ActTransferMoneyResponse::class;
21
22
    /**
23
     * Дата, с которой начать поиск (обязательный элемент)
24
     *
25
     * @JMS\Type("DateTime<'Y-m-d'>")
26
     * @JMS\SerializedName("from")
27
     */
28
    private \DateTimeInterface $from;
29
30
    /**
31
     * Дата, по которую вести поиск (по умолчанию "сегодня")
32
     *
33
     * @JMS\Type("DateTime<'Y-m-d'>")
34
     * @JMS\SerializedName("to")
35
     */
36
    private \DateTimeInterface $to;
37
38
    /**
39
     *  JSON|XML меняет формат ответа (по умолчанию "XML")
40
     *
41
     * @JMS\Type("string")
42
     * @JMS\SerializedName("output")
43
     */
44
    private string $output = 'XML';
0 ignored issues
show
introduced by
The private property $output is not used, and could be removed.
Loading history...
45
46
47
    /**
48
     * @param \DateTimeInterface $from
49
     * @param \DateTimeInterface $to
50
     */
51 1
    public function __construct(\DateTimeInterface $from, \DateTimeInterface $to)
52
    {
53 1
        $this->from = $from;
54 1
        $this->to = $to;
55
    }
56
57
    /**
58
     * @return \DateTimeInterface
59
     */
60 1
    public function getFrom(): \DateTimeInterface
61
    {
62 1
        return $this->from;
63
    }
64
65
    /**
66
     * @param \DateTimeInterface $from
67
     *
68
     * @return ActTransferMoneyRequest
69
     */
70 1
    public function setFrom(\DateTimeInterface $from): ActTransferMoneyRequest
71
    {
72 1
        $this->from = $from;
73 1
        return $this;
74
    }
75
76
    /**
77
     * @return \DateTimeInterface
78
     */
79 1
    public function getTo(): \DateTimeInterface
80
    {
81 1
        return $this->to;
82
    }
83
84
    /**
85
     * @param \DateTimeInterface $to
86
     *
87
     * @return ActTransferMoneyRequest
88
     */
89 1
    public function setTo(\DateTimeInterface $to): ActTransferMoneyRequest
90
    {
91 1
        $this->to = $to;
92 1
        return $this;
93
    }
94
}
95