Test Failed
Pull Request — master (#192)
by
unknown
03:49
created

RateTimeInTransitResponse::__construct()   C

Complexity

Conditions 7
Paths 33

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 56

Importance

Changes 0
Metric Value
dl 0
loc 22
ccs 0
cts 20
cp 0
rs 6.9811
c 0
b 0
f 0
cc 7
eloc 13
nc 33
nop 1
crap 56
1
<?php
2
3
namespace Ups\Entity;
4
5
use Ups\Entity\RateTimeInTransit\ServiceSummary as RateTimeInTransitServiceSummary;
6
7
class RateTimeInTransitResponse
8
{
9
    /**
10
     * @var string
11
     */
12
    public $PickupDate;
13
14
    /**
15
     * @var string
16
     */
17
    public $DocumentsOnlyIndicator;
18
19
    /**
20
     * @var string
21
     */
22
    public $PackageBillType;
23
24
    /**
25
     * @var ServiceSummary
26
     */
27
    public $ServiceSummary;
28
29
    /**
30
     * @var string
31
     */
32
    public $AutoDutyCode;
33
34
    /**
35
     * @var string
36
     */
37
    public $Disclaimer;
38
39
    /**
40
     * @param \stdClass|null $response
41
     */
42
    public function __construct(\stdClass $response = null)
43
    {
44
        $this->ServiceSummary = [];
0 ignored issues
show
Documentation Bug introduced by
It seems like array() of type array is incompatible with the declared type object<Ups\Entity\ServiceSummary> of property $ServiceSummary.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
45
46
        if (null !== $response) {
47
            if (isset($response->PickupDate)) {
48
                $this->PickupDate = $response->PickupDate;
49
            }
50
            if (isset($response->DocumentsOnlyIndicator)) {
51
                $this->DocumentsOnlyIndicator = $response->DocumentsOnlyIndicator;
52
            }
53
            if (isset($response->AutoDutyCode)) {
54
                $this->AutoDutyCode = $response->AutoDutyCode;
55
            }
56
            if (isset($response->Disclaimer)) {
57
                $this->Disclaimer = $response->Disclaimer;
58
            }
59
            if (isset($response->ServiceSummary)) {
60
                $this->ServiceSummary = new RateTimeInTransitServiceSummary($response->ServiceSummary);
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Ups\Entity\RateTime...sponse->ServiceSummary) of type object<Ups\Entity\RateTi...Transit\ServiceSummary> is incompatible with the declared type object<Ups\Entity\ServiceSummary> of property $ServiceSummary.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
61
            }
62
        }
63
    }
64
}
65