Test Failed
Push — main ( 80b66f...88de3c )
by Vasil
03:26
created

CalculationRecipient   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 52
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getSiteId() 0 3 1
A __construct() 0 8 1
A setSiteId() 0 3 1
A setPickupOfficeId() 0 3 1
A getPickupOfficeId() 0 3 1
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
    private bool $privatePerson;
21
22
    private ?CalculationAddressLocation $addressLocation = null;
23
24
    private ?int $siteId = null;
25
26
    private ?int $pickupOfficeId = null;
27
28
    public function __construct(
29
        bool $privatePerson,
30
        ?int $pickupOfficeId = null,
31
        ?CalculationAddressLocation $addressLocation = null
32
    ) {
33
        $this->privatePerson = $privatePerson;
34
        $this->pickupOfficeId = $pickupOfficeId;
35
        $this->addressLocation = $addressLocation;
36
    }
37
38
    /**
39
     * @param int|null $siteId
40
     */
41
    public function setSiteId(?int $siteId): void
42
    {
43
        $this->siteId = $siteId;
44
    }
45
46
    /**
47
     * @return int|null
48
     */
49
    public function getSiteId(): ?int
50
    {
51
        return $this->siteId;
52
    }
53
54
    /**
55
     * @param int|null $pickupOfficeId
56
     */
57
    public function setPickupOfficeId(?int $pickupOfficeId): void
58
    {
59
        $this->pickupOfficeId = $pickupOfficeId;
60
    }
61
62
    /**
63
     * @return int|null
64
     */
65
    public function getPickupOfficeId(): ?int
66
    {
67
        return $this->pickupOfficeId;
68
    }
69
}
70