TrackRequest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 18
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParcels() 0 3 1
A __construct() 0 3 1
A toArray() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Track;
6
7
use VasilDakov\Speedy\Property;
8
use VasilDakov\Speedy\Speedy;
9
10
/**
11
 * Class TrackRequest.
12
 *
13
 * @author Vasil Dakov <[email protected]>
14
 * @copyright 2009-2022 Neutrino.bg
15
 *
16
 * @version 1.0
17
 */
18
class TrackRequest
19
{
20
    private array $parcels;
21
22 2
    public function __construct(array $parcels)
23
    {
24 2
        $this->parcels = $parcels;
25
    }
26
27 1
    public function getParcels(): array
28
    {
29 1
        return $this->parcels;
30
    }
31
32 1
    public function toArray(): array
33
    {
34 1
        return [
35 1
            Property::PARCELS->value => $this->parcels,
36 1
        ];
37
    }
38
}
39