Passed
Push — master ( 17c5f7...cb633b )
by Stefan
04:29 queued 02:00
created

EstimatedArrival::__construct()   B

Complexity

Conditions 7
Paths 33

Size

Total Lines 21
Code Lines 13

Duplication

Lines 21
Ratio 100 %

Code Coverage

Tests 20
CRAP Score 7

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 21
loc 21
ccs 20
cts 20
cp 1
rs 7.551
cc 7
eloc 13
nc 33
nop 1
crap 7
1
<?php
2
3
namespace Ups\Entity;
4
5
class EstimatedArrival
6
{
7
    use EstimatedArrivalTrait;
8
9
    const EA_MONDAY = 'MON';
10
    const EA_TUESDAY = 'TUE';
11
    const EA_WEDNESDAY = 'WEB';
12
    const EA_THUSDAY = 'THU';
13
    const EA_FRIDAY = 'FRI';
14
    const EA_SATURDAY = 'SAT';
15
    // Sunday is an invalid day :-)
16
17
    private $BusinessTransitDays;
18
    private $Time;
19
    private $PickupDate;
20
    private $PickupTime;
21
    private $Date;
22
23
    /**
24
     * @param \stdClass|null $response
25
     */
26 5 View Code Duplication
    public function __construct(\stdClass $response = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28 5
        if (null !== $response) {
29 3
            $this->build($response);
30 3
            if (isset($response->BusinessTransitDays)) {
31 3
                $this->BusinessTransitDays = $response->BusinessTransitDays;
32 3
            }
33 3
            if (isset($response->Time)) {
34 3
                $this->Time = $response->Time;
35 3
            }
36 3
            if (isset($response->PickupDate)) {
37 3
                $this->PickupDate = $response->PickupDate;
38 3
            }
39 3
            if (isset($response->PickupTime)) {
40 3
                $this->PickupTime = $response->PickupTime;
41 3
            }
42 3
            if (isset($response->Date)) {
43 3
                $this->Date = $response->Date;
44 3
            }
45 3
        }
46 5
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getBusinessTransitDays()
52
    {
53
        return $this->BusinessTransitDays;
54
    }
55
56
    /**
57
     * @param string $BusinessTransitDays
58
     */
59
    public function setBusinessTransitDays($BusinessTransitDays)
60
    {
61
        $this->BusinessTransitDays = $BusinessTransitDays;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getTime()
68
    {
69
        return $this->Time;
70
    }
71
72
    /**
73
     * @param string $Time
74
     */
75
    public function setTime($Time)
76
    {
77
        $this->Time = $Time;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getPickupDate()
84
    {
85
        return $this->PickupDate;
86
    }
87
88
    /**
89
     * @param string $PickupDate
90
     */
91
    public function setPickupDate($PickupDate)
92
    {
93
        $this->PickupDate = $PickupDate;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getPickupTime()
100
    {
101
        return $this->PickupTime;
102
    }
103
104
    /**
105
     * @param string $PickupTime
106
     */
107
    public function setPickupTime($PickupTime)
108
    {
109
        $this->PickupTime = $PickupTime;
110
    }
111
112
    /**
113
     * @return string
114
     */
115
    public function getDate()
116
    {
117
        return $this->Date;
118
    }
119
120
    /**
121
     * @param string $Date
122
     */
123
    public function setDate($Date)
124
    {
125
        $this->Date = $Date;
126
    }
127
}
128