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

CalculationRecipient   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 50
ccs 16
cts 16
cp 1
rs 10
c 1
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getAddressLocation() 0 3 1
A getPickupOfficeId() 0 3 1
A isPrivatePerson() 0 3 1
A getSiteId() 0 3 1
A setSiteId() 0 3 1
A setPickupOfficeId() 0 3 1
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