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

ServiceSummary::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 9
CRAP Score 3

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 12
loc 12
ccs 9
cts 9
cp 1
rs 9.4285
cc 3
eloc 6
nc 3
nop 1
crap 3
1
<?php
2
3
namespace Ups\Entity;
4
5 View Code Duplication
class ServiceSummary
0 ignored issues
show
Duplication introduced by
This class 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...
6
{
7
    use ServiceSummaryTrait;
8
9
    /** @deprecated */
10
    public $EstimatedArrival;
11
12
    /**
13
     * @var EstimatedArrival
14
     */
15
    protected $estimatedArrival;
16
17
    /**
18
     * @param \stdClass|null $response
19
     */
20 4
    public function __construct(\stdClass $response = null)
21
    {
22 4
        $this->build($response);
23
        
24 4
        $this->setEstimatedArrival(new EstimatedArrival());
25
26 4
        if (null !== $response) {
27 3
            if (isset($response->EstimatedArrival)) {
28 3
                $this->setEstimatedArrival(new EstimatedArrival($response->EstimatedArrival));
29 3
            }
30 3
        }
31 4
    }
32
33
    /**
34
     * @return EstimatedArrival|null
35
     */
36
    public function getEstimatedArrival()
37
    {
38
        return $this->estimatedArrival;
39
    }
40
41
    /**
42
     * @param EstimatedArrival
43
     */
44 4
    public function setEstimatedArrival(EstimatedArrival $estimatedArrival)
45
    {
46 4
        $this->EstimatedArrival = $estimatedArrival;
0 ignored issues
show
Deprecated Code introduced by
The property Ups\Entity\ServiceSummary::$EstimatedArrival has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
47 4
        $this->estimatedArrival = $estimatedArrival;
48 4
    }
49
}
50