Passed
Push — main ( 5ffc2f...c28c5f )
by Vasil
08:14 queued 04:54
created

CalculationRecipient::getAddressLocation()   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
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Calculation;
6
7
use VasilDakov\Speedy\Traits\ToArray;
8
9
/**
10
 * Class CalculationRecipient.
11
 *
12
 * @author Vasil Dakov <[email protected]>
13
 * @copyright 2009-2022 Neutrino.bg
14
 *
15
 * @version 1.0
16
 */
17
class CalculationRecipient
18
{
19
    use ToArray;
20
21
    private bool $privatePerson;
22
23
    private ?CalculationAddressLocation $addressLocation = null;
24
25
    private ?int $siteId = null;
26
27
    private ?int $pickupOfficeId = null;
28
29 4
    public function __construct(
30
        bool $privatePerson,
31
        int $pickupOfficeId = null,
32
        CalculationAddressLocation $addressLocation = null
33
    ) {
34 4
        $this->privatePerson  = $privatePerson;
35 4
        $this->pickupOfficeId  = $pickupOfficeId;
36 4
        $this->addressLocation = $addressLocation;
37
    }
38
39 1
    public function isPrivatePerson(): bool
40
    {
41 1
        return $this->privatePerson;
42
    }
43
44 1
    public function setSiteId(?int $siteId): void
45
    {
46 1
        $this->siteId = $siteId;
47
    }
48
49 1
    public function getSiteId(): ?int
50
    {
51 1
        return $this->siteId;
52
    }
53
54 1
    public function setPickupOfficeId(?int $pickupOfficeId): void
55
    {
56 1
        $this->pickupOfficeId = $pickupOfficeId;
57
    }
58
59 1
    public function getPickupOfficeId(): ?int
60
    {
61 1
        return $this->pickupOfficeId;
62
    }
63
64 1
    public function getAddressLocation(): ?CalculationAddressLocation
65
    {
66 1
        return $this->addressLocation;
67
    }
68
}
69