Passed
Push — main ( 5489db...717dd1 )
by Vasil
15:04
created

ShipmentPhoneNumber::toArray()   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 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Shipment;
6
7
use VasilDakov\Speedy\Speedy;
8
use VasilDakov\Speedy\Traits\ToArray;
9
10
/**
11
 * Class ShipmentPhoneNumber
12
 *
13
 * @author Vasil Dakov <[email protected]>
14
 * @author Valentin Valkanov <[email protected]>
15
 * @copyright 2009-2022 Neutrino.bg
16
 * @version 1.0
17
 * @todo https://api.speedy.bg/web-api.html?fbclid=IwAR1pcF0uXsAZheAKesQcArBJ7QenkDVyEz36aXwfRGCQZvcInjIYMuE82E4#href-ds-shipment-phone-number
18
 */
19
class ShipmentPhoneNumber
20
{
21
    use ToArray;
22
23
    /**
24
     * @var string
25
     */
26
    private string $number;
27
28
    /**
29
     * @var string|null
30
     */
31
    private ?string $extension = null;
32
33
    /**
34
     * @param string $number
35
     */
36 5
    public function __construct(string $number)
37
    {
38 5
        $this->setNumber($number);
39
    }
40
41
    /**
42
     * @param string $number
43
     * @return void
44
     */
45 5
    private function setNumber(string $number): void
46
    {
47 5
        $this->number = $number;
48
    }
49
50
    /**
51
     * @return string number
52
     */
53 1
    public function getNumber(): string
54
    {
55 1
        return $this->number;
56
    }
57
58
    /**
59
     * @param string $extension
60
     * @return self
61
     */
62 1
    public function setExtension(string $extension): self
63
    {
64 1
        $this->extension = $extension;
65
66 1
        return $this;
67
    }
68
69
    /**
70
     * @return string|null
71
     */
72 1
    public function getExtension(): ?string
73
    {
74 1
        return $this->extension;
75
    }
76
}
77