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

RateTimeInTransitResponse   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 1
dl 0
loc 58
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
C __construct() 0 22 7
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