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

ServiceSummary::getEstimatedArrival()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
    /** @var  \Ups\Entity\TimeInTransit\EstimatedArrival */
12
    protected $estimatedArrival;
13
14
    /**
15
     * @param \stdClass|null $response
16
     */
17
    public function __construct(\stdClass $response = null)
18
    {
19
        self::build($response);
20
21
        $this->setEstimatedArrival(new EstimatedArrival());
22
23
        if (null !== $response) {
24
            if (isset($response->EstimatedArrival)) {
25
                $this->setEstimatedArrival(new EstimatedArrival($response->EstimatedArrival));
26
            }
27
        }
28
    }
29
30
    /**
31
     * @return \Ups\Entity\RateTimeInTransit\EstimatedArrival
32
     */
33
    public function getEstimatedArrival()
34
    {
35
        return $this->estimatedArrival;
36
    }
37
38
    /**
39
     * @param \Ups\Entity\RateTimeInTransit\EstimatedArrival
40
     */
41
    public function setEstimatedArrival(EstimatedArrival $estimatedArrival)
42
    {
43
        $this->estimatedArrival = $estimatedArrival;
0 ignored issues
show
Documentation Bug introduced by
It seems like $estimatedArrival of type object<Ups\Entity\RateTi...ansit\EstimatedArrival> is incompatible with the declared type object<Ups\Entity\TimeInTransit\EstimatedArrival> of property $estimatedArrival.

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...
44
    }
45
}
46