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

FindStreetRequest::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 0
cts 0
cp 0
crap 2
rs 10
c 0
b 0
f 0
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