Passed
Push — main ( d8c3bc...d030ca )
by Vasil
03:10
created

CalculationRecipient::setPickupOfficeId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Calculation;
6
7
use VasilDakov\Speedy\ToArray;
8
9
/**
10
 * Class CalculationRecipient
11
 *
12
 * @author Vasil Dakov <[email protected]>
13
 * @copyright 2009-2022 Neutrino.bg
14
 * @version 1.0
15
 */
16
class CalculationRecipient
17
{
18
    use ToArray;
19
20
    /**
21
     * @var bool
22
     */
23
    private bool $privatePerson;
24
25
    /**
26
     * @var CalculationAddressLocation|null
27
     */
28
    private ?CalculationAddressLocation $addressLocation = null;
29
30
    /**
31
     * @var int|null
32
     */
33
    private ?int $siteId = null;
34
35
    /**
36
     * @var int|null
37
     */
38
    private ?int $pickupOfficeId = null;
39
40
    /**
41
     * @param bool $privatePerson
42
     * @param int|null $pickupOfficeId
43
     * @param CalculationAddressLocation|null $addressLocation
44
     */
45 3
    public function __construct(
46
        bool $privatePerson,
47
        ?int $pickupOfficeId = null,
48
        ?CalculationAddressLocation $addressLocation = null
49
    ) {
50 3
        $this->privatePerson   = $privatePerson;
51 3
        $this->pickupOfficeId  = $pickupOfficeId;
52 3
        $this->addressLocation = $addressLocation;
53
    }
54
55
    /**
56
     * @return bool
57
     */
58 1
    public function isPrivatePerson(): bool
59
    {
60 1
        return $this->privatePerson;
61
    }
62
63
64
    /**
65
     * @param int|null $siteId
66
     */
67
    public function setSiteId(?int $siteId): void
68
    {
69
        $this->siteId = $siteId;
70
    }
71
72
    /**
73
     * @return int|null
74
     */
75
    public function getSiteId(): ?int
76
    {
77
        return $this->siteId;
78
    }
79
80
    /**
81
     * @param int|null $pickupOfficeId
82
     */
83
    public function setPickupOfficeId(?int $pickupOfficeId): void
84
    {
85
        $this->pickupOfficeId = $pickupOfficeId;
86
    }
87
88
    /**
89
     * @return int|null
90
     */
91 1
    public function getPickupOfficeId(): ?int
92
    {
93 1
        return $this->pickupOfficeId;
94
    }
95
96
    /**
97
     * @return CalculationAddressLocation|null
98
     */
99 1
    public function getAddressLocation(): ?CalculationAddressLocation
100
    {
101 1
        return $this->addressLocation;
102
    }
103
}
104