Completed
Pull Request — master (#145)
by
unknown
03:03
created

EstimatedArrival   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 90.7%

Importance

Changes 0
Metric Value
wmc 15
lcom 0
cbo 2
dl 0
loc 71
ccs 39
cts 43
cp 0.907
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
F __construct() 0 44 15
1
<?php
2
3
namespace Ups\Entity;
4
5
class EstimatedArrival
6
{
7
    const EA_MONDAY = 'MON';
8
    const EA_TUESDAY = 'TUE';
9
    const EA_WEDNESDAY = 'WEB';
10
    const EA_THUSDAY = 'THU';
11
    const EA_FRIDAY = 'FRI';
12
    const EA_SATURDAY = 'SAT';
13
    // Sunday is an invalid day :-)
14
15
    public $BusinessTransitDays;
16
    public $Time;
17
    public $Arrival;
18
    public $PickupDate;
19
    public $PickupTime;
20
    public $HolidayCount;
21
    public $DelayCount;
22
    public $Date;
23
    public $DayOfWeek;
24
    public $TotalTransitDays;
25
    public $CustomerCenterCutoff;
26
    public $RestDays;
27
28
    /**
29
     * @param \stdClass|null $response
30
     */
31 5
    public function __construct(\stdClass $response = null)
32
    {
33 5
        if (null !== $response) {
34 3
            if (isset($response->BusinessTransitDays)) {
35 3
                $this->BusinessTransitDays = $response->BusinessTransitDays;
36 3
            }
37 3
            if (isset($response->Time)) {
38 3
                $this->Time = $response->Time;
39 3
            }
40 3
            if (isset($response->PickupDate)) {
41 3
                $this->PickupDate = $response->PickupDate;
42 3
            }
43 3
            if (isset($response->PickupTime)) {
44 3
                $this->PickupTime = $response->PickupTime;
45 3
            }
46 3
            if (isset($response->HolidayCount)) {
47 3
                $this->HolidayCount = $response->HolidayCount;
48 3
            }
49 3
            if (isset($response->DelayCount)) {
50 3
                $this->DelayCount = $response->DelayCount;
51 3
            }
52 3
            if (isset($response->Date)) {
53 3
                $this->Date = $response->Date;
54 3
            }
55 3
            if (isset($response->DayOfWeek)) {
56 3
                $this->DayOfWeek = $response->DayOfWeek;
57 3
            }
58 3
            if (isset($response->TotalTransitDays)) {
59 3
                $this->TotalTransitDays = $response->TotalTransitDays;
60 3
            }
61 3
            if (isset($response->CustomerCenterCutoff)) {
62 3
                $this->CustomerCenterCutoff = $response->CustomerCenterCutoff;
63 3
            }
64 3
            if (isset($response->RestDays)) {
65 3
                $this->RestDays = $response->RestDays;
66 3
            }
67 3
            if (isset($response->Arrival)) {
68
                $this->Arrival = new Arrival($response->Arrival);
69
            }
70 3
            if (isset($response->Pickup)) {
71
                $this->Pickup = new Pickup($response->Pickup);
0 ignored issues
show
Bug introduced by
The property Pickup does not seem to exist. Did you mean PickupDate?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
72
            }
73 3
        }
74 5
    }
75
}
76