Passed
Pull Request — master (#193)
by Stefan
02:31
created

ServiceSummaryTrait::getSaturdayDelivery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Ups\Entity;
4
5
trait ServiceSummaryTrait
6
{
7
    /** @deprecated */
8
    public $Service;
9
10
    /** @deprecated */
11
    public $Guaranteed;
12
13
    /** @deprecated */
14
    public $SaturdayDelivery;
15
16
    /** @deprecated */
17
    public $SaturdayDeliveryDisclaimer;
18
19
20
    /** @var  \Ups\Entity\Service */
21
    protected $service;
22
23
    /** @var  \Ups\Entity\Guaranteed */
24
    protected $guaranteed;
25
26
    /** @var mixed  */
27
    protected $saturdayDelivery;
28
29
    /** @var mixed  */
30
    protected $saturdayDeliveryDisclaimer;
31
32
    /**
33
     * @param \stdClass|null $response
34
     */
35 4
    public function build(\stdClass $response = null)
36
    {
37 4
        $this->setService(new Service());
38 4
        $this->setGuaranteed(new Guaranteed());
39
40 4
        if (null !== $response) {
41 3
            if (isset($response->Service)) {
42 3
                $this->setService(new Service($response->Service));
43 3
            }
44 3
            if (isset($response->Guaranteed)) {
45 3
                $this->setGuaranteed(new Guaranteed($response->Guaranteed));
46 3
            }
47 3
        }
48 4
    }
49
50
    /**
51
     * @return \Ups\Entity\Service
52
     */
53
    public function getService()
54
    {
55
        return $this->service;
56
    }
57
58
    /**
59
     * @param \Ups\Entity\Service $service
60
     */
61 4
    public function setService(Service $service)
62
    {
63 4
        $this->Service = $service;
0 ignored issues
show
Deprecated Code introduced by
The property Ups\Entity\ServiceSummaryTrait::$Service has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
64 4
        $this->service = $service;
65 4
    }
66
67
    /**
68
     * @return \Ups\Entity\Guaranteed
69
     */
70
    public function getGuaranteed()
71
    {
72
        return $this->guaranteed;
73
    }
74
75
    /**
76
     * @param \Ups\Entity\Guaranteed $guaranteed
77
     */
78 4
    public function setGuaranteed(Guaranteed $guaranteed)
79
    {
80 4
        $this->Guaranteed = $guaranteed;
0 ignored issues
show
Deprecated Code introduced by
The property Ups\Entity\ServiceSummaryTrait::$Guaranteed has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
81 4
        $this->guaranteed = $guaranteed;
82 4
    }
83
84
    /**
85
     * @return mixed
86
     */
87
    public function getSaturdayDelivery()
88
    {
89
        return $this->saturdayDelivery;
90
    }
91
92
    /**
93
     * @param mixed $saturdayDelivery
94
     */
95
    public function setSaturdayDelivery($saturdayDelivery)
96
    {
97
        $this->SaturdayDelivery = $saturdayDelivery;
0 ignored issues
show
Deprecated Code introduced by
The property Ups\Entity\ServiceSummaryTrait::$SaturdayDelivery has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
98
        $this->saturdayDelivery = $saturdayDelivery;
99
    }
100
101
    /**
102
     * @return mixed
103
     */
104
    public function getSaturdayDeliveryDisclaimer()
105
    {
106
        return $this->saturdayDeliveryDisclaimer;
107
    }
108
109
    /**
110
     * @param mixed $saturdayDeliveryDisclaimer
111
     */
112
    public function setSaturdayDeliveryDisclaimer($saturdayDeliveryDisclaimer)
113
    {
114
        $this->SaturdayDeliveryDisclaimer = $saturdayDeliveryDisclaimer;
0 ignored issues
show
Deprecated Code introduced by
The property Ups\Entity\ServiceSummar...urdayDeliveryDisclaimer has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
115
        $this->saturdayDeliveryDisclaimer = $saturdayDeliveryDisclaimer;
116
    }
117
}
118