Completed
Pull Request — master (#145)
by
unknown
03:03
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
class RateTimeInTransitResponse
6
{
7
    /**
8
     * @var string
9
     */
10
    public $PickupDate;
11
12
    /**
13
     * @var string
14
     */
15
    public $DocumentsOnlyIndicator;
16
17
    /**
18
     * @var string
19
     */
20
    public $PackageBillType;
21
22
    /**
23
     * @var ServiceSummary
24
     */
25
    public $ServiceSummary;
26
27
    /**
28
     * @var string
29
     */
30
    public $AutoDutyCode;
31
32
    /**
33
     * @var string
34
     */
35
    public $Disclaimer;
36
37
    /**
38
     * @param \stdClass|null $response
39
     */
40
    public function __construct(\stdClass $response = null)
41
    {
42
        $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...
43
44
        if (null !== $response) {
45
            if (isset($response->PickupDate)) {
46
                $this->PickupDate = $response->PickupDate;
47
            }
48
            if (isset($response->DocumentsOnlyIndicator)) {
49
                $this->DocumentsOnlyIndicator = $response->DocumentsOnlyIndicator;
50
            }
51
            if (isset($response->AutoDutyCode)) {
52
                $this->AutoDutyCode = $response->AutoDutyCode;
53
            }
54
            if (isset($response->Disclaimer)) {
55
                $this->Disclaimer = $response->Disclaimer;
56
            }
57
            if (isset($response->ServiceSummary)) {
58
                $this->ServiceSummary = new ServiceSummary($response->ServiceSummary);
59
            }
60
        }
61
    }
62
}
63