Total Complexity | 60 |
Total Lines | 452 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like TelephonySmsUserMultiSend often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use TelephonySmsUserMultiSend, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
12 | class TelephonySmsUserMultiSend extends AbstractStructBase |
||
13 | { |
||
14 | /** |
||
15 | * The login |
||
16 | * Meta information extracted from the WSDL |
||
17 | * - nillable: true |
||
18 | * @var string |
||
19 | */ |
||
20 | public $login; |
||
21 | /** |
||
22 | * The password |
||
23 | * Meta information extracted from the WSDL |
||
24 | * - nillable: true |
||
25 | * @var string |
||
26 | */ |
||
27 | public $password; |
||
28 | /** |
||
29 | * The smsAccount |
||
30 | * Meta information extracted from the WSDL |
||
31 | * - nillable: true |
||
32 | * @var string |
||
33 | */ |
||
34 | public $smsAccount; |
||
35 | /** |
||
36 | * The numberFrom |
||
37 | * Meta information extracted from the WSDL |
||
38 | * - nillable: true |
||
39 | * @var string |
||
40 | */ |
||
41 | public $numberFrom; |
||
42 | /** |
||
43 | * The numberTo |
||
44 | * Meta information extracted from the WSDL |
||
45 | * - nillable: true |
||
46 | * @var \Ovh\ArrayType\MyArrayOfStringType |
||
47 | */ |
||
48 | public $numberTo; |
||
49 | /** |
||
50 | * The message |
||
51 | * Meta information extracted from the WSDL |
||
52 | * - nillable: true |
||
53 | * @var string |
||
54 | */ |
||
55 | public $message; |
||
56 | /** |
||
57 | * The smsValidity |
||
58 | * Meta information extracted from the WSDL |
||
59 | * - nillable: true |
||
60 | * @var int |
||
61 | */ |
||
62 | public $smsValidity; |
||
63 | /** |
||
64 | * The smsClass |
||
65 | * Meta information extracted from the WSDL |
||
66 | * - nillable: true |
||
67 | * @var int |
||
68 | */ |
||
69 | public $smsClass; |
||
70 | /** |
||
71 | * The smsDeferred |
||
72 | * Meta information extracted from the WSDL |
||
73 | * - nillable: true |
||
74 | * @var int |
||
75 | */ |
||
76 | public $smsDeferred; |
||
77 | /** |
||
78 | * The smsPriority |
||
79 | * Meta information extracted from the WSDL |
||
80 | * - nillable: true |
||
81 | * @var int |
||
82 | */ |
||
83 | public $smsPriority; |
||
84 | /** |
||
85 | * The smsCoding |
||
86 | * Meta information extracted from the WSDL |
||
87 | * - nillable: true |
||
88 | * @var int |
||
89 | */ |
||
90 | public $smsCoding; |
||
91 | /** |
||
92 | * The tag |
||
93 | * Meta information extracted from the WSDL |
||
94 | * - nillable: true |
||
95 | * @var string |
||
96 | */ |
||
97 | public $tag; |
||
98 | /** |
||
99 | * The numberToCsv |
||
100 | * Meta information extracted from the WSDL |
||
101 | * - nillable: true |
||
102 | * @var string |
||
103 | */ |
||
104 | public $numberToCsv; |
||
105 | /** |
||
106 | * The noStop |
||
107 | * Meta information extracted from the WSDL |
||
108 | * - nillable: true |
||
109 | * @var bool |
||
110 | */ |
||
111 | public $noStop; |
||
112 | /** |
||
113 | * Constructor method for telephonySmsUserMultiSend |
||
114 | * @uses TelephonySmsUserMultiSend::setLogin() |
||
115 | * @uses TelephonySmsUserMultiSend::setPassword() |
||
116 | * @uses TelephonySmsUserMultiSend::setSmsAccount() |
||
117 | * @uses TelephonySmsUserMultiSend::setNumberFrom() |
||
118 | * @uses TelephonySmsUserMultiSend::setNumberTo() |
||
119 | * @uses TelephonySmsUserMultiSend::setMessage() |
||
120 | * @uses TelephonySmsUserMultiSend::setSmsValidity() |
||
121 | * @uses TelephonySmsUserMultiSend::setSmsClass() |
||
122 | * @uses TelephonySmsUserMultiSend::setSmsDeferred() |
||
123 | * @uses TelephonySmsUserMultiSend::setSmsPriority() |
||
124 | * @uses TelephonySmsUserMultiSend::setSmsCoding() |
||
125 | * @uses TelephonySmsUserMultiSend::setTag() |
||
126 | * @uses TelephonySmsUserMultiSend::setNumberToCsv() |
||
127 | * @uses TelephonySmsUserMultiSend::setNoStop() |
||
128 | * @param string $login |
||
129 | * @param string $password |
||
130 | * @param string $smsAccount |
||
131 | * @param string $numberFrom |
||
132 | * @param \Ovh\ArrayType\MyArrayOfStringType $numberTo |
||
133 | * @param string $message |
||
134 | * @param int $smsValidity |
||
135 | * @param int $smsClass |
||
136 | * @param int $smsDeferred |
||
137 | * @param int $smsPriority |
||
138 | * @param int $smsCoding |
||
139 | * @param string $tag |
||
140 | * @param string $numberToCsv |
||
141 | * @param bool $noStop |
||
142 | */ |
||
143 | public function __construct($login = null, $password = null, $smsAccount = null, $numberFrom = null, \Ovh\ArrayType\MyArrayOfStringType $numberTo = null, $message = null, $smsValidity = null, $smsClass = null, $smsDeferred = null, $smsPriority = null, $smsCoding = null, $tag = null, $numberToCsv = null, $noStop = null) |
||
160 | } |
||
161 | /** |
||
162 | * Get login value |
||
163 | * @return string|null |
||
164 | */ |
||
165 | public function getLogin() |
||
168 | } |
||
169 | /** |
||
170 | * Set login value |
||
171 | * @param string $login |
||
172 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
173 | */ |
||
174 | public function setLogin($login = null) |
||
175 | { |
||
176 | // validation for constraint: string |
||
177 | if (!is_null($login) && !is_string($login)) { |
||
|
|||
178 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($login, true), gettype($login)), __LINE__); |
||
179 | } |
||
180 | $this->login = $login; |
||
181 | return $this; |
||
182 | } |
||
183 | /** |
||
184 | * Get password value |
||
185 | * @return string|null |
||
186 | */ |
||
187 | public function getPassword() |
||
190 | } |
||
191 | /** |
||
192 | * Set password value |
||
193 | * @param string $password |
||
194 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
195 | */ |
||
196 | public function setPassword($password = null) |
||
197 | { |
||
198 | // validation for constraint: string |
||
199 | if (!is_null($password) && !is_string($password)) { |
||
200 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); |
||
201 | } |
||
202 | $this->password = $password; |
||
203 | return $this; |
||
204 | } |
||
205 | /** |
||
206 | * Get smsAccount value |
||
207 | * @return string|null |
||
208 | */ |
||
209 | public function getSmsAccount() |
||
212 | } |
||
213 | /** |
||
214 | * Set smsAccount value |
||
215 | * @param string $smsAccount |
||
216 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
217 | */ |
||
218 | public function setSmsAccount($smsAccount = null) |
||
219 | { |
||
220 | // validation for constraint: string |
||
221 | if (!is_null($smsAccount) && !is_string($smsAccount)) { |
||
222 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($smsAccount, true), gettype($smsAccount)), __LINE__); |
||
223 | } |
||
224 | $this->smsAccount = $smsAccount; |
||
225 | return $this; |
||
226 | } |
||
227 | /** |
||
228 | * Get numberFrom value |
||
229 | * @return string|null |
||
230 | */ |
||
231 | public function getNumberFrom() |
||
232 | { |
||
233 | return $this->numberFrom; |
||
234 | } |
||
235 | /** |
||
236 | * Set numberFrom value |
||
237 | * @param string $numberFrom |
||
238 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
239 | */ |
||
240 | public function setNumberFrom($numberFrom = null) |
||
241 | { |
||
242 | // validation for constraint: string |
||
243 | if (!is_null($numberFrom) && !is_string($numberFrom)) { |
||
244 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($numberFrom, true), gettype($numberFrom)), __LINE__); |
||
245 | } |
||
246 | $this->numberFrom = $numberFrom; |
||
247 | return $this; |
||
248 | } |
||
249 | /** |
||
250 | * Get numberTo value |
||
251 | * @return \Ovh\ArrayType\MyArrayOfStringType|null |
||
252 | */ |
||
253 | public function getNumberTo() |
||
254 | { |
||
255 | return $this->numberTo; |
||
256 | } |
||
257 | /** |
||
258 | * Set numberTo value |
||
259 | * @param \Ovh\ArrayType\MyArrayOfStringType $numberTo |
||
260 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
261 | */ |
||
262 | public function setNumberTo(\Ovh\ArrayType\MyArrayOfStringType $numberTo = null) |
||
263 | { |
||
264 | $this->numberTo = $numberTo; |
||
265 | return $this; |
||
266 | } |
||
267 | /** |
||
268 | * Get message value |
||
269 | * @return string|null |
||
270 | */ |
||
271 | public function getMessage() |
||
272 | { |
||
273 | return $this->message; |
||
274 | } |
||
275 | /** |
||
276 | * Set message value |
||
277 | * @param string $message |
||
278 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
279 | */ |
||
280 | public function setMessage($message = null) |
||
281 | { |
||
282 | // validation for constraint: string |
||
283 | if (!is_null($message) && !is_string($message)) { |
||
284 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($message, true), gettype($message)), __LINE__); |
||
285 | } |
||
286 | $this->message = $message; |
||
287 | return $this; |
||
288 | } |
||
289 | /** |
||
290 | * Get smsValidity value |
||
291 | * @return int|null |
||
292 | */ |
||
293 | public function getSmsValidity() |
||
294 | { |
||
295 | return $this->smsValidity; |
||
296 | } |
||
297 | /** |
||
298 | * Set smsValidity value |
||
299 | * @param int $smsValidity |
||
300 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
301 | */ |
||
302 | public function setSmsValidity($smsValidity = null) |
||
303 | { |
||
304 | // validation for constraint: int |
||
305 | if (!is_null($smsValidity) && !(is_int($smsValidity) || ctype_digit($smsValidity))) { |
||
306 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($smsValidity, true), gettype($smsValidity)), __LINE__); |
||
307 | } |
||
308 | $this->smsValidity = $smsValidity; |
||
309 | return $this; |
||
310 | } |
||
311 | /** |
||
312 | * Get smsClass value |
||
313 | * @return int|null |
||
314 | */ |
||
315 | public function getSmsClass() |
||
316 | { |
||
317 | return $this->smsClass; |
||
318 | } |
||
319 | /** |
||
320 | * Set smsClass value |
||
321 | * @param int $smsClass |
||
322 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
323 | */ |
||
324 | public function setSmsClass($smsClass = null) |
||
325 | { |
||
326 | // validation for constraint: int |
||
327 | if (!is_null($smsClass) && !(is_int($smsClass) || ctype_digit($smsClass))) { |
||
328 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($smsClass, true), gettype($smsClass)), __LINE__); |
||
329 | } |
||
330 | $this->smsClass = $smsClass; |
||
331 | return $this; |
||
332 | } |
||
333 | /** |
||
334 | * Get smsDeferred value |
||
335 | * @return int|null |
||
336 | */ |
||
337 | public function getSmsDeferred() |
||
338 | { |
||
339 | return $this->smsDeferred; |
||
340 | } |
||
341 | /** |
||
342 | * Set smsDeferred value |
||
343 | * @param int $smsDeferred |
||
344 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
345 | */ |
||
346 | public function setSmsDeferred($smsDeferred = null) |
||
347 | { |
||
348 | // validation for constraint: int |
||
349 | if (!is_null($smsDeferred) && !(is_int($smsDeferred) || ctype_digit($smsDeferred))) { |
||
350 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($smsDeferred, true), gettype($smsDeferred)), __LINE__); |
||
351 | } |
||
352 | $this->smsDeferred = $smsDeferred; |
||
353 | return $this; |
||
354 | } |
||
355 | /** |
||
356 | * Get smsPriority value |
||
357 | * @return int|null |
||
358 | */ |
||
359 | public function getSmsPriority() |
||
360 | { |
||
361 | return $this->smsPriority; |
||
362 | } |
||
363 | /** |
||
364 | * Set smsPriority value |
||
365 | * @param int $smsPriority |
||
366 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
367 | */ |
||
368 | public function setSmsPriority($smsPriority = null) |
||
376 | } |
||
377 | /** |
||
378 | * Get smsCoding value |
||
379 | * @return int|null |
||
380 | */ |
||
381 | public function getSmsCoding() |
||
384 | } |
||
385 | /** |
||
386 | * Set smsCoding value |
||
387 | * @param int $smsCoding |
||
388 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
389 | */ |
||
390 | public function setSmsCoding($smsCoding = null) |
||
391 | { |
||
392 | // validation for constraint: int |
||
393 | if (!is_null($smsCoding) && !(is_int($smsCoding) || ctype_digit($smsCoding))) { |
||
394 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($smsCoding, true), gettype($smsCoding)), __LINE__); |
||
395 | } |
||
396 | $this->smsCoding = $smsCoding; |
||
397 | return $this; |
||
398 | } |
||
399 | /** |
||
400 | * Get tag value |
||
401 | * @return string|null |
||
402 | */ |
||
403 | public function getTag() |
||
404 | { |
||
405 | return $this->tag; |
||
406 | } |
||
407 | /** |
||
408 | * Set tag value |
||
409 | * @param string $tag |
||
410 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
411 | */ |
||
412 | public function setTag($tag = null) |
||
413 | { |
||
414 | // validation for constraint: string |
||
415 | if (!is_null($tag) && !is_string($tag)) { |
||
416 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($tag, true), gettype($tag)), __LINE__); |
||
417 | } |
||
418 | $this->tag = $tag; |
||
419 | return $this; |
||
420 | } |
||
421 | /** |
||
422 | * Get numberToCsv value |
||
423 | * @return string|null |
||
424 | */ |
||
425 | public function getNumberToCsv() |
||
426 | { |
||
427 | return $this->numberToCsv; |
||
428 | } |
||
429 | /** |
||
430 | * Set numberToCsv value |
||
431 | * @param string $numberToCsv |
||
432 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
433 | */ |
||
434 | public function setNumberToCsv($numberToCsv = null) |
||
435 | { |
||
436 | // validation for constraint: string |
||
437 | if (!is_null($numberToCsv) && !is_string($numberToCsv)) { |
||
438 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($numberToCsv, true), gettype($numberToCsv)), __LINE__); |
||
439 | } |
||
440 | $this->numberToCsv = $numberToCsv; |
||
441 | return $this; |
||
442 | } |
||
443 | /** |
||
444 | * Get noStop value |
||
445 | * @return bool|null |
||
446 | */ |
||
447 | public function getNoStop() |
||
448 | { |
||
449 | return $this->noStop; |
||
450 | } |
||
451 | /** |
||
452 | * Set noStop value |
||
453 | * @param bool $noStop |
||
454 | * @return \Ovh\StructType\TelephonySmsUserMultiSend |
||
455 | */ |
||
456 | public function setNoStop($noStop = null) |
||
464 | } |
||
465 | } |
||
466 |