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
    /**
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

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
    /**
13
     * @var EstimatedArrival
14
     */
15
    protected $estimatedArrival;
16
17
    /**
18
     * @param \stdClass|null $response
19
     */
20
    public function __construct(\stdClass $response = null)
21
    {
22
        $this->build($response);
23
        
24
        $this->setEstimatedArrival(new EstimatedArrival());
25
26
        if (null !== $response) {
27
            if (isset($response->EstimatedArrival)) {
28
                $this->setEstimatedArrival(new EstimatedArrival($response->EstimatedArrival));
29
            }
30
        }
31
    }
32
33
    /**
34
     * @return EstimatedArrival|null
35
     */
36
    public function getEstimatedArrival()
37
    {
38
        return $this->estimatedArrival;
39
    }
40
41
    /**
42
     * @param EstimatedArrival
43
     */
44
    public function setEstimatedArrival(EstimatedArrival $estimatedArrival)
45
    {
46
        $this->EstimatedArrival = $estimatedArrival;
47
        $this->estimatedArrival = $estimatedArrival;
48
    }
49
}
50