Passed
Push — main ( 6bf038...55787e )
by Aleksandr
08:10
created

DeliveryCostRequest   A

Complexity

Total Complexity 36

Size/Duplication

Total Lines 489
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 74
c 1
b 0
f 0
dl 0
loc 489
ccs 90
cts 90
cp 1
rs 9.52
wmc 36

36 Methods

Rating   Name   Duplication   Size   Complexity  
A getWidth() 0 3 1
A setOblName() 0 4 1
A setWeight() 0 4 1
A getLength() 0 3 1
A setTypeDelivery() 0 4 1
A getWithoutTax() 0 3 1
A getCashServices() 0 3 1
A setHeight() 0 4 1
A getTypeDelivery() 0 3 1
A getOblName() 0 3 1
A setCashServices() 0 4 1
A getCdekCityId() 0 3 1
A setOutput() 0 4 1
A getInshprice() 0 3 1
A getPartner() 0 3 1
A setCdekCityId() 0 4 1
A getWeight() 0 3 1
A setTownTo() 0 4 1
A getPrice() 0 3 1
A setTo() 0 4 1
A getTo() 0 3 1
A getTownTo() 0 3 1
A setPartner() 0 4 1
A setLength() 0 4 1
A getOutput() 0 3 1
A setPvzCode() 0 4 1
A setWidth() 0 4 1
A setFias() 0 4 1
A getPvzCode() 0 3 1
A getHeight() 0 3 1
A getKladr() 0 3 1
A getFias() 0 3 1
A setPrice() 0 4 1
A setInshprice() 0 4 1
A setKladr() 0 4 1
A setWithoutTax() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Requests;
6
7
use DalliSDK\Responses\DeliveryCostResponse;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Запрос на предварительный расчет стоимости
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/cost-delivery
14
 * @JMS\XmlRoot("deliverycost")
15
 */
16
class DeliveryCostRequest extends AbstractRequest implements RequestInterface
17
{
18
    public const RESPONSE_CLASS = DeliveryCostResponse::class;
19
20
    /**
21
     * Идентификатор партнера, может принимать значения
22
     * @JMS\Type("string")
23
     */
24
    private ?string $partner = null;
25
26
    /**
27
     * Полный адрес получателя. Доступен только для собственной доставки Dalli
28
     *
29
     * @JMS\Type("string")
30
     */
31
    private ?string $to = null;
32
33
    /**
34
     * Город доставки в текстовом виде. Не рекомендуется
35
     *
36
     * @deprecated Не рекомендуется
37
     * @JMS\Type("string")
38
     * @JMS\SerializedName("townto")
39
     */
40
    private ?string $townTo = null;
41
42
    /**
43
     * Код ФИАС. Рекомендуем использовать именно его, а не текстовое название города
44
     *
45
     * @JMS\Type("string")
46
     */
47
    private ?string $fias = null;
48
49
    /**
50
     * КЛАДР
51
     *
52
     * @JMS\Type("string")
53
     */
54
    private ?string $kladr = null;
55
56
    /**
57
     * Код пункта выдачи заказов
58
     *
59
     * @JMS\Type("string")
60
     * @JMS\SerializedName("pvzcode")
61
     */
62
    private ?string $pvzCode = null;
63
64
    /**
65
     * Код города в системе СДЕК(можно указывать только при доставке СДЕКом)
66
     *
67
     * @JMS\Type("int")
68
     * @JMS\SerializedName("cdekcityid")
69
     */
70
    private ?int $cdekCityId = null;
71
72
    /**
73
     * Область
74
     *
75
     * @JMS\Type("string")
76
     * @JMS\SerializedName("oblname")
77
     */
78
    private ?string $oblName = null;
79
80
    /**
81
     * Вес заказа, кг
82
     *
83
     * @JMS\Type("int")
84
     */
85
    private ?int $weight = null;
86
87
    /**
88
     * Стоимость заказа
89
     *
90
     * @JMS\Type("int")
91
     */
92
    private ?int $price = null;
93
94
    /**
95
     * Объявленная стоимость заказа
96
     *
97
     * @JMS\Type("int")
98
     */
99
    private ?int $inshprice = null;
100
101
    /**
102
     * Оплата картой (используется для запроса стоимости доставки только DS), может принимать значения:
103
     *  NO - наличными (значение по-умолчанию)
104
     *  YES - картой
105
     *
106
     * @JMS\Type("string")
107
     * @JMS\SerializedName("cashservices")
108
     */
109
    private ?string $cashServices = 'NO';
110
111
    /**
112
     * Длина, см
113
     *
114
     * @JMS\Type("int")
115
     */
116
    private ?int $length = null;
117
118
    /**
119
     * Ширина, см
120
     *
121
     * @JMS\Type("int")
122
     */
123
    private ?int $width = null;
124
125
    /**
126
     * Высота, см
127
     *
128
     * @JMS\Type("int")
129
     */
130
    private ?int $height = null;
131
132
    /**
133
     * Тип доставки, может принимать значения (бесполезен при output x2):
134
     *  KUR - курьерская доставка
135
     *  PVZ - пункт выдачи заказов ПВЗ
136
     *
137
     * @JMS\Type("string")
138
     * @JMS\SerializedName("typedelivery")
139
     */
140
    private ?string $typeDelivery = null;
141
142
    /**
143
     * Запрос базовой стоимости доставки (используется для запроса стоимости доставки только DS), может принимать значения:
144
     *  NO - Полная стоимость, включающая все комиссии (значение по-умолчанию)
145
     *  YES - Базовая стоимость доставки без доп услуг
146
     *
147
     * @JMS\Type("string")
148
     * @JMS\SerializedName("withouttax")
149
     */
150
    private ?string $withoutTax = null;
151
152
    /**
153
     * Меняет формат ответа
154
     *  x2 - расширенный формат. Обязателен для Почты России
155
     *
156
     * @JMS\Type("string")
157
     * @JMS\SerializedName("output")
158
     */
159
    private ?string $output = null;
160
161
    /**
162
     * @return string|null
163
     */
164 1
    public function getPartner(): ?string
165
    {
166 1
        return $this->partner;
167
    }
168
169
    /**
170
     * @param string|null $partner
171
     *
172
     * @return DeliveryCostRequest
173
     */
174 1
    public function setPartner(?string $partner): DeliveryCostRequest
175
    {
176 1
        $this->partner = $partner;
177 1
        return $this;
178
    }
179
180
    /**
181
     * @return string|null
182
     */
183 1
    public function getTo(): ?string
184
    {
185 1
        return $this->to;
186
    }
187
188
    /**
189
     * @param string|null $to
190
     *
191
     * @return DeliveryCostRequest
192
     */
193 1
    public function setTo(?string $to): DeliveryCostRequest
194
    {
195 1
        $this->to = $to;
196 1
        return $this;
197
    }
198
199
    /**
200
     * @return string|null
201
     * @deprecated Не рекомендуется
202
     */
203 1
    public function getTownTo(): ?string
204
    {
205 1
        return $this->townTo;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Requests\DeliveryCostRequest::$townTo has been deprecated: Не рекомендуется ( Ignorable by Annotation )

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

205
        return /** @scrutinizer ignore-deprecated */ $this->townTo;

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...
206
    }
207
208
    /**
209
     *
210
     * @param string|null $townTo
211
     *
212
     * @return DeliveryCostRequest
213
     * @deprecated Не рекомендуется
214
     *
215
     */
216 1
    public function setTownTo(?string $townTo): DeliveryCostRequest
217
    {
218 1
        $this->townTo = $townTo;
0 ignored issues
show
Deprecated Code introduced by
The property DalliSDK\Requests\DeliveryCostRequest::$townTo has been deprecated: Не рекомендуется ( Ignorable by Annotation )

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

218
        /** @scrutinizer ignore-deprecated */ $this->townTo = $townTo;

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...
219 1
        return $this;
220
    }
221
222
    /**
223
     * @return string|null
224
     */
225 1
    public function getFias(): ?string
226
    {
227 1
        return $this->fias;
228
    }
229
230
    /**
231
     * @param string|null $fias
232
     *
233
     * @return DeliveryCostRequest
234
     */
235 1
    public function setFias(?string $fias): DeliveryCostRequest
236
    {
237 1
        $this->fias = $fias;
238 1
        return $this;
239
    }
240
241
    /**
242
     * @return string|null
243
     */
244 1
    public function getKladr(): ?string
245
    {
246 1
        return $this->kladr;
247
    }
248
249
    /**
250
     * @param string|null $kladr
251
     *
252
     * @return DeliveryCostRequest
253
     */
254 1
    public function setKladr(?string $kladr): DeliveryCostRequest
255
    {
256 1
        $this->kladr = $kladr;
257 1
        return $this;
258
    }
259
260
    /**
261
     * @return string|null
262
     */
263 1
    public function getPvzCode(): ?string
264
    {
265 1
        return $this->pvzCode;
266
    }
267
268
    /**
269
     * @param string|null $pvzCode
270
     *
271
     * @return DeliveryCostRequest
272
     */
273 1
    public function setPvzCode(?string $pvzCode): DeliveryCostRequest
274
    {
275 1
        $this->pvzCode = $pvzCode;
276 1
        return $this;
277
    }
278
279
    /**
280
     * @return int|null
281
     */
282 1
    public function getCdekCityId(): ?int
283
    {
284 1
        return $this->cdekCityId;
285
    }
286
287
    /**
288
     * @param int|null $cdekCityId
289
     *
290
     * @return DeliveryCostRequest
291
     */
292 1
    public function setCdekCityId(?int $cdekCityId): DeliveryCostRequest
293
    {
294 1
        $this->cdekCityId = $cdekCityId;
295 1
        return $this;
296
    }
297
298
    /**
299
     * @return string|null
300
     */
301 1
    public function getOblName(): ?string
302
    {
303 1
        return $this->oblName;
304
    }
305
306
    /**
307
     * @param string|null $oblName
308
     *
309
     * @return DeliveryCostRequest
310
     */
311 1
    public function setOblName(?string $oblName): DeliveryCostRequest
312
    {
313 1
        $this->oblName = $oblName;
314 1
        return $this;
315
    }
316
317
    /**
318
     * @return int|null
319
     */
320 1
    public function getWeight(): ?int
321
    {
322 1
        return $this->weight;
323
    }
324
325
    /**
326
     * @param int|null $weight
327
     *
328
     * @return DeliveryCostRequest
329
     */
330 1
    public function setWeight(?int $weight): DeliveryCostRequest
331
    {
332 1
        $this->weight = $weight;
333 1
        return $this;
334
    }
335
336
    /**
337
     * @return int|null
338
     */
339 1
    public function getPrice(): ?int
340
    {
341 1
        return $this->price;
342
    }
343
344
    /**
345
     * @param int|null $price
346
     *
347
     * @return DeliveryCostRequest
348
     */
349 1
    public function setPrice(?int $price): DeliveryCostRequest
350
    {
351 1
        $this->price = $price;
352 1
        return $this;
353
    }
354
355
    /**
356
     * @return int|null
357
     */
358 1
    public function getInshprice(): ?int
359
    {
360 1
        return $this->inshprice;
361
    }
362
363
    /**
364
     * @param int|null $inshprice
365
     *
366
     * @return DeliveryCostRequest
367
     */
368 1
    public function setInshprice(?int $inshprice): DeliveryCostRequest
369
    {
370 1
        $this->inshprice = $inshprice;
371 1
        return $this;
372
    }
373
374
    /**
375
     * @return string|null
376
     */
377 1
    public function getCashServices(): ?string
378
    {
379 1
        return $this->cashServices;
380
    }
381
382
    /**
383
     * @param string|null $cashServices
384
     *
385
     * @return DeliveryCostRequest
386
     */
387 1
    public function setCashServices(?string $cashServices): DeliveryCostRequest
388
    {
389 1
        $this->cashServices = $cashServices;
390 1
        return $this;
391
    }
392
393
    /**
394
     * @return int|null
395
     */
396 1
    public function getLength(): ?int
397
    {
398 1
        return $this->length;
399
    }
400
401
    /**
402
     * @param int|null $length
403
     *
404
     * @return DeliveryCostRequest
405
     */
406 1
    public function setLength(?int $length): DeliveryCostRequest
407
    {
408 1
        $this->length = $length;
409 1
        return $this;
410
    }
411
412
    /**
413
     * @return int|null
414
     */
415 1
    public function getWidth(): ?int
416
    {
417 1
        return $this->width;
418
    }
419
420
    /**
421
     * @param int|null $width
422
     *
423
     * @return DeliveryCostRequest
424
     */
425 1
    public function setWidth(?int $width): DeliveryCostRequest
426
    {
427 1
        $this->width = $width;
428 1
        return $this;
429
    }
430
431
    /**
432
     * @return int|null
433
     */
434 1
    public function getHeight(): ?int
435
    {
436 1
        return $this->height;
437
    }
438
439
    /**
440
     * @param int|null $height
441
     *
442
     * @return DeliveryCostRequest
443
     */
444 1
    public function setHeight(?int $height): DeliveryCostRequest
445
    {
446 1
        $this->height = $height;
447 1
        return $this;
448
    }
449
450
    /**
451
     * @return string|null
452
     */
453 1
    public function getTypeDelivery(): ?string
454
    {
455 1
        return $this->typeDelivery;
456
    }
457
458
    /**
459
     * @param string|null $typeDelivery
460
     *
461
     * @return DeliveryCostRequest
462
     */
463 1
    public function setTypeDelivery(?string $typeDelivery): DeliveryCostRequest
464
    {
465 1
        $this->typeDelivery = $typeDelivery;
466 1
        return $this;
467
    }
468
469
    /**
470
     * @return string|null
471
     */
472 1
    public function getWithoutTax(): ?string
473
    {
474 1
        return $this->withoutTax;
475
    }
476
477
    /**
478
     * @param string|null $withoutTax
479
     *
480
     * @return DeliveryCostRequest
481
     */
482 1
    public function setWithoutTax(?string $withoutTax): DeliveryCostRequest
483
    {
484 1
        $this->withoutTax = $withoutTax;
485 1
        return $this;
486
    }
487
488
    /**
489
     * @return string|null
490
     */
491 1
    public function getOutput(): ?string
492
    {
493 1
        return $this->output;
494
    }
495
496
    /**
497
     * @param string|null $output
498
     *
499
     * @return DeliveryCostRequest
500
     */
501 1
    public function setOutput(?string $output): DeliveryCostRequest
502
    {
503 1
        $this->output = $output;
504 1
        return $this;
505
    }
506
}
507