Passed
Push — main ( ed4b4c...986270 )
by Aleksandr
09:15
created

PolygonsRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DalliSDK\Requests;
6
7
use DalliSDK\Responses\RawDataResponse;
8
use JMS\Serializer\Annotation as JMS;
9
10
/**
11
 * Запрос списка полигонов в формате GeoJSON
12
 *
13
 * @see https://api.dalli-service.com/v1/doc/getpolygons
14
 * @JMS\XmlRoot("getPolygons")
15
 */
16
class PolygonsRequest extends AbstractRequest implements RequestInterface, MustRawJson
17
{
18
    public const RESPONSE_CLASS = RawDataResponse::class;
19
20
    /**
21
     * Тип доставки
22
     *
23
     * @JMS\Type("int")
24
     * @JMS\SerializedName("service")
25
     */
26
    private int $service;
27
28
    /**
29
     * Зона доставки
30
     *
31
     * @JMS\Type("int")
32
     * @JMS\SerializedName("zone")
33
     */
34
    private int $zone;
35
36
    /**
37
     * Код филиала
38
     *
39
     * @JMS\Type("int")
40
     * @JMS\SerializedName("filial")
41
     */
42
    private int $filial;
43
44
    /**
45
     * @param int $service
46
     * @param int $zone
47
     * @param int $filial
48
     */
49 2
    public function __construct(int $service, int $zone, int $filial)
50
    {
51 2
        $this->service = $service;
52 2
        $this->zone = $zone;
53 2
        $this->filial = $filial;
54
    }
55
56
    /**
57
     * @return int
58
     */
59 1
    public function getService(): int
60
    {
61 1
        return $this->service;
62
    }
63
64
    /**
65
     * @return int
66
     */
67 1
    public function getZone(): int
68
    {
69 1
        return $this->zone;
70
    }
71
72
    /**
73
     * @return int
74
     */
75 1
    public function getFilialCode(): int
76
    {
77 1
        return $this->filial;
78
    }
79
}
80