Issues (24)

src/Models/Receiver.php (2 issues)

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/createbasket
14
 * @JMS\XmlRoot("receiver")
15
 */
16
class Receiver
17
{
18
    use Fillable;
19
20
    /**
21
     * Контактное лицо (поддержка Dalli заказала, что это одни и то же с $person)
22
     * @see Receiver::$person
23
     *
24
     * @JMS\Type("string")
25
     * @JMS\SerializedName("company")
26
     */
27
    private ?string $company = null;
28
29
    /**
30
     * Индекс
31
     *
32
     * @JMS\Type("string")
33
     * @JMS\SerializedName("zipcode")
34
     */
35
    private ?string $zipCode = null;
36
37
    /**
38
     * Город (тег обязателен для курьерской доставки, но игнорируется для ПВЗ)
39
     *  Может быть:
40
     *       Строковым названием города в формате "Москва город"
41
     *       13-ти значным кодом адресного классификатора КЛАДР
42
     *       36-ти значным кодом адресной системы ФИАС
43
     *
44
     * @JMS\Type("string")
45
     * @JMS\SerializedName("town")
46
     *
47
     * @deprecated deprecated since version 1.4.0
48
     */
49
    private ?string $town = null;
50
51
    /**
52
     * Точный ФИАС (до дома, квартиры или улицы).
53
     * При использовании точного ФИАС, дополнительную информацию (подъезд, этаж, код домофона)
54
     * можно написать в поле адреса ($this->address).
55
     * Главное, не дублировать информацию, указанную в коде ФИАС (необязательный тег)
56
     *
57
     * @JMS\Type("string")
58
     * @JMS\SerializedName("fias")
59
     */
60
    private ?string $fias = null;
61
62
    /**
63
     * Адрес (обязательный тег, если тип доставки относится к курьерской доставке)
64
     *
65
     * @JMS\Type("string")
66
     * @JMS\SerializedName("address")
67
     */
68
    private ?string $address = null;
69
70
    /**
71
     * Полный адрес одной строкой (Желательно, используется ВМЕСТО town+address)
72
     *
73
     * @JMS\Type("string")
74
     * @JMS\SerializedName("to")
75
     */
76
    private ?string $to = null;
77
78
    /**
79
     * Код пункта выдачи заказов (обязательный тег, если тип доставки относится к ПВЗ)
80
     *
81
     * @JMS\Type("string")
82
     * @JMS\SerializedName("pvzcode")
83
     */
84
    private ?string $pvzcode = null;
85
86
    /**
87
     * Контактное лицо (обязательный тег)
88
     *
89
     * @JMS\Type("string")
90
     * @JMS\SerializedName("person")
91
     */
92
    private string $person;
93
94
    /**
95
     * Телефон (обязательный тег). Так же в это поле можно добавить электронную почту получателя.
96
     *
97
     * @JMS\Type("string")
98
     * @JMS\SerializedName("phone")
99
     */
100
    private string $phone;
101
102
    /**
103
     * Дата доставки в формате yyyy-mm-dd. Не играет роли при передаче партнёрам (обязательный тег)
104
     *
105
     * @JMS\Type("DateTime<'Y-m-d'>")
106
     * @JMS\SerializedName("date")
107
     */
108
    private \DateTimeInterface $date;
109
110
    /**
111
     * Желаемое время доставки, в формате hh:mm (обязательный тег)
112
     *
113
     * @JMS\Type("string")
114
     * @JMS\SerializedName("time_min")
115
     */
116
    private string $timeMin;
117
118
    /**
119
     * Желаемое время доставки, в формате hh:mm (обязательный тег)
120
     *
121
     * @JMS\Type("string")
122
     * @JMS\SerializedName("time_max")
123
     */
124
    private string $timeMax;
125
126
    /**
127
     * @return string|null
128
     */
129 4
    public function getCompany(): ?string
130
    {
131 4
        return $this->company;
132
    }
133
134
    /**
135
     * @return string|null
136
     */
137 3
    public function getZipCode(): ?string
138
    {
139 3
        return $this->zipCode;
140
    }
141
142
    /**
143
     * @return string|null
144
     * @deprecated deprecated since version 1.4.0
145
     */
146 3
    public function getTown(): ?string
147
    {
148 3
        return $this->town;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Models\Receiver::$town has been deprecated: deprecated since version 1.4.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

148
        return /** @scrutinizer ignore-deprecated */ $this->town;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
149
    }
150
151
    /**
152
     * @return string|null
153
     */
154 2
    public function getFias(): ?string
155
    {
156 2
        return $this->fias;
157
    }
158
159
    /**
160
     * @return string|null
161
     */
162 3
    public function getAddress(): ?string
163
    {
164 3
        return $this->address;
165
    }
166
167
    /**
168
     * @return string|null
169
     */
170 4
    public function getPvzcode(): ?string
171
    {
172 4
        return $this->pvzcode;
173
    }
174
175
    /**
176
     * @return string
177
     */
178 3
    public function getPerson(): string
179
    {
180 3
        return $this->person;
181
    }
182
183
    /**
184
     * @return string
185
     */
186 3
    public function getPhone(): string
187
    {
188 3
        return $this->phone;
189
    }
190
191
    /**
192
     * @return \DateTimeInterface
193
     */
194 3
    public function getDate(): \DateTimeInterface
195
    {
196 3
        return $this->date;
197
    }
198
199
    /**
200
     * @return string
201
     */
202 3
    public function getTimeMin(): string
203
    {
204 3
        return $this->timeMin;
205
    }
206
207
    /**
208
     * @return string
209
     */
210 3
    public function getTimeMax(): string
211
    {
212 3
        return $this->timeMax;
213
    }
214
215
    /**
216
     * @param string|null $company
217
     *
218
     * @return Receiver
219
     */
220 1
    public function setCompany(?string $company): Receiver
221
    {
222 1
        $this->company = $company;
223 1
        return $this;
224
    }
225
226
    /**
227
     * @param string|null $zipCode
228
     *
229
     * @return Receiver
230
     */
231 1
    public function setZipCode(?string $zipCode): Receiver
232
    {
233 1
        $this->zipCode = $zipCode;
234 1
        return $this;
235
    }
236
237
    /**
238
     * @param string|null $town
239
     *
240
     * @return Receiver
241
     * @deprecated deprecated since version 1.4.0
242
     */
243 23
    public function setTown(?string $town): Receiver
244
    {
245 23
        $this->town = $town;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Models\Receiver::$town has been deprecated: deprecated since version 1.4.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

245
        /** @scrutinizer ignore-deprecated */ $this->town = $town;

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
246 23
        return $this;
247
    }
248
249
    /**
250
     * @param string|null $fias
251
     *
252
     * @return Receiver
253
     */
254 5
    public function setFias(?string $fias): Receiver
255
    {
256 5
        $this->fias = $fias;
257 5
        return $this;
258
    }
259
260
    /**
261
     * @param string|null $address
262
     *
263
     * @return Receiver
264
     */
265 23
    public function setAddress(?string $address): Receiver
266
    {
267 23
        $this->address = $address;
268 23
        return $this;
269
    }
270
271
    /**
272
     * @param string|null $pvzcode
273
     *
274
     * @return Receiver
275
     */
276 1
    public function setPvzcode(?string $pvzcode): Receiver
277
    {
278 1
        $this->pvzcode = $pvzcode;
279 1
        return $this;
280
    }
281
282
    /**
283
     * @param string $person
284
     *
285
     * @return Receiver
286
     */
287 23
    public function setPerson(string $person): Receiver
288
    {
289 23
        $this->person = $person;
290 23
        return $this;
291
    }
292
293
    /**
294
     * @param string $phone
295
     *
296
     * @return Receiver
297
     */
298 23
    public function setPhone(string $phone): Receiver
299
    {
300 23
        $this->phone = $phone;
301 23
        return $this;
302
    }
303
304
    /**
305
     * @param \DateTimeInterface $date
306
     *
307
     * @return Receiver
308
     */
309 22
    public function setDate(\DateTimeInterface $date): Receiver
310
    {
311 22
        $this->date = $date;
312 22
        return $this;
313
    }
314
315
    /**
316
     * @param string $timeMin
317
     *
318
     * @return Receiver
319
     */
320 22
    public function setTimeMin(string $timeMin): Receiver
321
    {
322 22
        $this->timeMin = $timeMin;
323 22
        return $this;
324
    }
325
326
    /**
327
     * @param string $timeMax
328
     *
329
     * @return Receiver
330
     */
331 22
    public function setTimeMax(string $timeMax): Receiver
332
    {
333 22
        $this->timeMax = $timeMax;
334 22
        return $this;
335
    }
336
337
    /**
338
     * @return string|null
339
     */
340 1
    public function getTo(): ?string
341
    {
342 1
        return $this->to;
343
    }
344
345
    /**
346
     * @param string|null $to
347
     *
348
     * @return Receiver
349
     */
350 2
    public function setTo(?string $to): Receiver
351
    {
352 2
        $this->to = $to;
353 2
        return $this;
354
    }
355
}
356