Code Duplication    Length = 39-43 lines in 2 locations

src/Entity/RateTimeInTransit/ServiceSummary.php 1 location

@@ 7-45 (lines=39) @@
4
5
use Ups\Entity\ServiceSummaryTrait;
6
7
class ServiceSummary
8
{
9
    use ServiceSummaryTrait;
10
11
    /** @var  \Ups\Entity\RateTimeInTransit\EstimatedArrival */
12
    protected $estimatedArrival;
13
14
    /**
15
     * @param \stdClass|null $response
16
     */
17
    public function __construct(\stdClass $response = null)
18
    {
19
        $this->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;
44
    }
45
}
46

src/Entity/ServiceSummary.php 1 location

@@ 5-47 (lines=43) @@
2
3
namespace Ups\Entity;
4
5
class ServiceSummary
6
{
7
    use ServiceSummaryTrait;
8
9
    /** @deprecated */
10
    public $EstimatedArrival;
11
12
    /** @var  \Ups\Entity\EstimatedArrival */
13
    protected $estimatedArrival;
14
15
    /**
16
     * @param \stdClass|null $response
17
     */
18
    public function __construct(\stdClass $response = null)
19
    {
20
        $this->build($response);
21
        
22
        $this->setEstimatedArrival(new EstimatedArrival());
23
24
        if (null !== $response) {
25
            if (isset($response->EstimatedArrival)) {
26
                $this->setEstimatedArrival(new EstimatedArrival($response->EstimatedArrival));
27
            }
28
        }
29
    }
30
31
    /**
32
     * @return \Ups\Entity\EstimatedArrival
33
     */
34
    public function getEstimatedArrival()
35
    {
36
        return $this->estimatedArrival;
37
    }
38
39
    /**
40
     * @param \Ups\Entity\EstimatedArrival
41
     */
42
    public function setEstimatedArrival(EstimatedArrival $estimatedArrival)
43
    {
44
        $this->EstimatedArrival = $estimatedArrival;
45
        $this->estimatedArrival = $estimatedArrival;
46
    }
47
}
48