Code Duplication    Length = 39-42 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\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;
44
    }
45
}
46

src/Entity/ServiceSummary.php 1 location

@@ 5-46 (lines=42) @@
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
        self::build($response);
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\EstimatedArrival
32
     */
33
    public function getEstimatedArrival()
34
    {
35
        return $this->estimatedArrival;
36
    }
37
38
    /**
39
     * @param \Ups\Entity\EstimatedArrival
40
     */
41
    public function setEstimatedArrival(EstimatedArrival $estimatedArrival)
42
    {
43
        $this->EstimatedArrival = $estimatedArrival;
44
        $this->estimatedArrival = $estimatedArrival;
45
    }
46
}
47