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

ServiceSummary::setEstimatedArrival()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 3
Ratio 75 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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