Passed
Push — main ( 2bc5a4...5ffc2f )
by Vasil
16:31 queued 13:09
created

DestinationServicesRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
dl 0
loc 18
ccs 2
cts 4
cp 0.5
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRecipient() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the Neutrino package.
5
 *
6
 * (c) Vasil Dakov <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace VasilDakov\Speedy\Service\Service;
15
16
use VasilDakov\Speedy\Service\Calculation\CalculationRecipient;
17
use VasilDakov\Speedy\Service\Calculation\CalculationSender;
18
use VasilDakov\Speedy\Service\Shipment\CreateShipmentRequest;
19
use VasilDakov\Speedy\Service\Shipment\ShipmentRecipient;
20
use VasilDakov\Speedy\Traits\ToArray;
21
22
/**
23
 * Class DestinationServicesRequest.
24
 *
25
 * @author Vasil Dakov <[email protected]>
26
 * @copyright 2009-2023 Neutrino.bg
27
 *
28
 * @version 1.0
29
 */
30
class DestinationServicesRequest extends CreateShipmentRequest
31
{
32
    use ToArray;
33
34
    private ?\DateTime $date = null;
0 ignored issues
show
introduced by
The private property $date is not used, and could be removed.
Loading history...
35
36
    private ?CalculationSender $sender = null;
0 ignored issues
show
introduced by
The private property $sender is not used, and could be removed.
Loading history...
37
38
    private CalculationRecipient $recipient;
39
40 1
    public function __construct(CalculationRecipient $recipient)
41
    {
42 1
        $this->recipient = $recipient;
43
    }
44
45
    public function getRecipient(): ShipmentRecipient
46
    {
47
        return $this->recipient;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->recipient returns the type VasilDakov\Speedy\Servic...on\CalculationRecipient which is incompatible with the type-hinted return VasilDakov\Speedy\Servic...pment\ShipmentRecipient.
Loading history...
48
    }
49
}
50