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

PointRequest::getPvzcode()   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\Requests;
6
7
use DalliSDK\Responses\PointResponse;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Запрос списка ПВЗ
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/pointsInfo
14
 * @JMS\XmlRoot("pointsInfo")
15
 */
16
class PointRequest extends AbstractRequest implements RequestInterface
17
{
18
    public const RESPONSE_CLASS = PointResponse::class;
19
20
    /**
21
     * Может принимать значения: DS, SDEK, BOXBERRY, 5POST
22
     *
23
     * @JMS\Type("string")
24
     * @JMS\SerializedName("partner")
25
     */
26
    private ?string $partner = null;
27
28
    /**
29
     * Код ФИАС. Указывается вместо города и области. Рекомендуем использовать именно его, а не текстовое название города
30
     *
31
     * @JMS\Type("string")
32
     * @JMS\SerializedName("fias")
33
     */
34
    private ?string $fias = null;
35
36
    /**
37
     * Область
38
     *
39
     * @JMS\Type("string")
40
     * @JMS\SerializedName("settlement")
41
     */
42
    private ?string $settlement = null;
43
44
    /**
45
     * Город (не рекомендуется)
46
     *
47
     * @JMS\Type("string")
48
     * @JMS\SerializedName("town")
49
     */
50
    private ?string $town = null;
51
52
    /**
53
     * Код ПВЗ
54
     * Параметры поиска ПВЗ не являются обязательными. Если не указан ни один параметр, то вы получите список всех ПВЗ
55
     *
56
     * @JMS\Type("string")
57
     * @JMS\SerializedName("pvzcode")
58
     */
59
    private ?string $pvzcode = null;
60
61
    /**
62
     * Индекс
63
     *
64
     * @JMS\Type("string")
65
     * @JMS\SerializedName("zipcode")
66
     */
67
    private ?string $zipcode = null;
68
69
    /**
70
     * @param string|null $town
71
     * @param string|null $partner
72
     * @param string|null $settlement
73
     * @param string|null $fias
74
     * @param string|null $zipcode
75
     */
76 2
    public function __construct(?string $town = null, ?string $partner = null, ?string $settlement = null, ?string $fias = null, ?string $zipcode = null)
77
    {
78 2
        $this->town = $town;
79 2
        $this->partner = $partner;
80 2
        $this->settlement = $settlement;
81 2
        $this->fias = $fias;
82 2
        $this->zipcode = $zipcode;
83
    }
84
85
    /**
86
     * @return string|null
87
     */
88 2
    public function getTown(): ?string
89
    {
90 2
        return $this->town;
91
    }
92
93
    /**
94
     * @param string|null $town
95
     *
96
     * @return PointRequest
97
     */
98 1
    public function setTown(?string $town): PointRequest
99
    {
100 1
        $this->town = $town;
101 1
        return $this;
102
    }
103
104
    /**
105
     * @return string|null
106
     */
107 2
    public function getPartner(): ?string
108
    {
109 2
        return $this->partner;
110
    }
111
112
    /**
113
     * @param string|null $partner
114
     *
115
     * @return PointRequest
116
     */
117 2
    public function setPartner(?string $partner): PointRequest
118
    {
119
        //todo add enums validation
120 2
        $this->partner = $partner;
121 2
        return $this;
122
    }
123
124
    /**
125
     * @return string|null
126
     */
127 2
    public function getSettlement(): ?string
128
    {
129 2
        return $this->settlement;
130
    }
131
132
    /**
133
     * @param string|null $settlement
134
     *
135
     * @return PointRequest
136
     */
137 1
    public function setSettlement(?string $settlement): PointRequest
138
    {
139 1
        $this->settlement = $settlement;
140 1
        return $this;
141
    }
142
143
    /**
144
     * @return string|null
145
     */
146 2
    public function getFias(): ?string
147
    {
148 2
        return $this->fias;
149
    }
150
151
    /**
152
     * @param string|null $fias
153
     *
154
     * @return PointRequest
155
     */
156 1
    public function setFias(?string $fias): PointRequest
157
    {
158 1
        $this->fias = $fias;
159 1
        return $this;
160
    }
161
162
    /**
163
     * @return string|null
164
     */
165 2
    public function getZipcode(): ?string
166
    {
167 2
        return $this->zipcode;
168
    }
169
170
    /**
171
     * @param string|null $zipcode
172
     *
173
     * @return PointRequest
174
     */
175 1
    public function setZipcode(?string $zipcode): PointRequest
176
    {
177 1
        $this->zipcode = $zipcode;
178 1
        return $this;
179
    }
180
181
    /**
182
     * @return string|null
183
     */
184 1
    public function getPvzcode(): ?string
185
    {
186 1
        return $this->pvzcode;
187
    }
188
189
    /**
190
     * @param string|null $pvzcode
191
     *
192
     * @return PointRequest
193
     */
194 1
    public function setPvzcode(?string $pvzcode): PointRequest
195
    {
196 1
        $this->pvzcode = $pvzcode;
197 1
        return $this;
198
    }
199
}
200