Test Failed
Push — main ( 7b8973...13a4fc )
by Vasil
06:57 queued 03:30
created

FindStreetRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 47
ccs 4
cts 10
cp 0.4
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 3 1
A toArray() 0 6 1
A getName() 0 3 1
A getSiteId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Location\Street;
6
7
use VasilDakov\Speedy\Property;
8
use VasilDakov\Speedy\Traits\ToArray;
9
10
/**
11
 * Class FindStreetRequest.
12
 *
13
 * @author Vasil Dakov <[email protected]>
14
 * @copyright 2009-2022 Neutrino.bg
15
 *
16
 * @version 1.0
17
 */
18
class FindStreetRequest
19
{
20
    use ToArray;
0 ignored issues
show
Bug introduced by
The trait VasilDakov\Speedy\Traits\ToArray requires the property $value which is not provided by VasilDakov\Speedy\Servic...treet\FindStreetRequest.
Loading history...
21
22
    private int $siteId;
23
24
    private string $name;
25
26
    private ?string $type = null;
27 1
28
    public function __construct(int $siteId, string $name, ?string $type = null)
29 1
    {
30 1
        $this->siteId = $siteId;
31 1
        $this->name = $name;
32
        $this->type = $type;
33
    }
34
35
    /**
36
     * @return int
37
     */
38
    public function getSiteId(): int
39
    {
40
        return $this->siteId;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getName(): string
47
    {
48
        return $this->name;
49
    }
50
51
    /**
52
     * @return string|null
53
     */
54
    public function getType(): ?string
55
    {
56
        return $this->type;
57
    }
58
59
    public function toArray(): array
60
    {
61
        return [
62
            Property::SITE_ID->value => $this->siteId,
63
            Property::NAME->value => $this->name,
64
            Property::TYPE->value => $this->type,
65
        ];
66
    }
67
}
68