Passed
Push — master ( ba9899...92e7eb )
by Ross
02:29
created

Plan::getIsSubscribed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
declare(strict_types=1);
3
/**
4
 *
5
 * Copyright (C) 2018  Ross Mitchell
6
 *
7
 * This file is part of RossMitchell/UpdateCloudFlare.
8
 *
9
 * RossMitchell/UpdateCloudFlare is free software: you can redistribute
10
 * it and/or modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation, either version 3 of the
12
 * License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
namespace RossMitchell\UpdateCloudFlare\Responses\Results;
24
25
use RossMitchell\UpdateCloudFlare\Helpers\Hydrator;
26
use Symfony\Component\Console\Exception\LogicException;
27
28
/**
29
 * Class Plan
30
 * @package RossMitchell\UpdateCloudFlare\Responses\Results
31
 */
32
class Plan
33
{
34
    /**
35
     * @var string
36
     */
37
    private $id;
38
    /**
39
     * @var string
40
     */
41
    private $name;
42
    /**
43
     * @var float
44
     */
45
    private $price;
46
    /**
47
     * @var string
48
     */
49
    private $currency;
50
    /**
51
     * @var string
52
     */
53
    private $frequency;
54
    /**
55
     * @var string
56
     */
57
    private $legacyId;
58
    /**
59
     * @var string
60
     */
61
    private $isSubscribed;
62
    /**
63
     * @var string
64
     */
65
    private $canSubscribe;
66
67
    /**
68
     * Plan constructor.
69
     *
70
     * @param Hydrator  $hydrator
71
     * @param \stdClass $data
72
     *
73
     * @throws LogicException
74
     */
75
    public function __construct(Hydrator $hydrator, \stdClass $data)
76
    {
77
        $hydrator->setProperty($this, $data, 'id');
78
        $hydrator->setProperty($this, $data, 'name');
79
        $hydrator->setProperty($this, $data, 'price');
80
        $hydrator->setProperty($this, $data, 'currency');
81
        $hydrator->setProperty($this, $data, 'frequency');
82
        $hydrator->setProperty($this, $data, 'legacy_id');
83
        $hydrator->setProperty($this, $data, 'is_subscribed');
84
        $hydrator->setProperty($this, $data, 'can_subscribe');
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getId(): string
91
    {
92
        return $this->id;
93
    }
94
95
    /**
96
     * @param string $id
97
     */
98
    public function setId(string $id)
99
    {
100
        $this->id = $id;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getName(): string
107
    {
108
        return $this->name;
109
    }
110
111
    /**
112
     * @param string $name
113
     */
114
    public function setName(string $name)
115
    {
116
        $this->name = $name;
117
    }
118
119
    /**
120
     * @return float
121
     */
122
    public function getPrice(): float
123
    {
124
        return $this->price;
125
    }
126
127
    /**
128
     * @param float $price
129
     */
130
    public function setPrice(float $price)
131
    {
132
        $this->price = $price;
133
    }
134
135
    /**
136
     * @return string
137
     */
138
    public function getCurrency(): string
139
    {
140
        return $this->currency;
141
    }
142
143
    /**
144
     * @param string $currency
145
     */
146
    public function setCurrency(string $currency)
147
    {
148
        $this->currency = $currency;
149
    }
150
151
    /**
152
     * @return string
153
     */
154
    public function getFrequency(): string
155
    {
156
        return $this->frequency;
157
    }
158
159
    /**
160
     * @param string $frequency
161
     */
162
    public function setFrequency(string $frequency)
163
    {
164
        $this->frequency = $frequency;
165
    }
166
167
    /**
168
     * @return string
169
     */
170
    public function getLegacyId(): string
171
    {
172
        return $this->legacyId;
173
    }
174
175
    /**
176
     * @param string $legacyId
177
     */
178
    public function setLegacyId(string $legacyId)
179
    {
180
        $this->legacyId = $legacyId;
181
    }
182
183
    /**
184
     * @return string
185
     */
186
    public function getIsSubscribed(): string
187
    {
188
        return $this->isSubscribed;
189
    }
190
191
    /**
192
     * @param string $isSubscribed
193
     */
194
    public function setIsSubscribed(string $isSubscribed)
195
    {
196
        $this->isSubscribed = $isSubscribed;
197
    }
198
199
    /**
200
     * @return string
201
     */
202
    public function getCanSubscribe(): string
203
    {
204
        return $this->canSubscribe;
205
    }
206
207
    /**
208
     * @param string $canSubscribe
209
     */
210
    public function setCanSubscribe(string $canSubscribe)
211
    {
212
        $this->canSubscribe = $canSubscribe;
213
    }
214
}
215