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

DestinationServicesRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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