TelephonyFaxOptionsModify   F
last analyzed

Complexity

Total Complexity 62

Size/Duplication

Total Lines 488
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 107
dl 0
loc 488
rs 3.44
c 0
b 0
f 0
wmc 62

31 Methods

Rating   Name   Duplication   Size   Complexity  
A setReceivId() 0 8 3
A __construct() 0 18 1
A setFromName() 0 8 3
A setRedirection3Email() 0 8 3
A setRedirection1Email() 0 8 3
A getRedirection4Email() 0 3 1
A getFromEmail() 0 3 1
A getFaxMaxCall() 0 3 1
A setFromEmail() 0 8 3
A getReceivId() 0 3 1
A getNumber() 0 3 1
A setRedirection2Email() 0 8 3
A getRedirection2Email() 0 3 1
A getRedirection3Email() 0 3 1
A setFaxTagLine() 0 8 3
A setRedirection5Email() 0 8 3
A getFaxTagLine() 0 3 1
A getFromName() 0 3 1
A getSenderId() 0 3 1
A setNumber() 0 8 3
A getCountry() 0 3 1
A getRedirection1Email() 0 3 1
A getRedirection5Email() 0 3 1
A setRedirection4Email() 0 8 3
A setFaxQuality() 0 8 3
A setSenderId() 0 8 3
A setCountry() 0 8 3
A setFaxMaxCall() 0 8 4
A setSession() 0 8 3
A getFaxQuality() 0 3 1
A getSession() 0 3 1

How to fix   Complexity   

Complex Class

Complex classes like TelephonyFaxOptionsModify 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 TelephonyFaxOptionsModify, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Ovh\StructType;
4
5
use \WsdlToPhp\PackageBase\AbstractStructBase;
6
7
/**
8
 * This class stands for telephonyFaxOptionsModify StructType
9
 * @subpackage Structs
10
 * @author WsdlToPhp <[email protected]>
11
 */
12
class TelephonyFaxOptionsModify extends AbstractStructBase
13
{
14
    /**
15
     * The session
16
     * Meta information extracted from the WSDL
17
     * - nillable: true
18
     * @var string
19
     */
20
    public $session;
21
    /**
22
     * The number
23
     * Meta information extracted from the WSDL
24
     * - nillable: true
25
     * @var string
26
     */
27
    public $number;
28
    /**
29
     * The country
30
     * Meta information extracted from the WSDL
31
     * - nillable: true
32
     * @var string
33
     */
34
    public $country;
35
    /**
36
     * The fromName
37
     * Meta information extracted from the WSDL
38
     * - nillable: true
39
     * @var string
40
     */
41
    public $fromName;
42
    /**
43
     * The fromEmail
44
     * Meta information extracted from the WSDL
45
     * - nillable: true
46
     * @var string
47
     */
48
    public $fromEmail;
49
    /**
50
     * The faxQuality
51
     * Meta information extracted from the WSDL
52
     * - nillable: true
53
     * @var string
54
     */
55
    public $faxQuality;
56
    /**
57
     * The faxTagLine
58
     * Meta information extracted from the WSDL
59
     * - nillable: true
60
     * @var string
61
     */
62
    public $faxTagLine;
63
    /**
64
     * The faxMaxCall
65
     * Meta information extracted from the WSDL
66
     * - nillable: true
67
     * @var int
68
     */
69
    public $faxMaxCall;
70
    /**
71
     * The receivId
72
     * Meta information extracted from the WSDL
73
     * - nillable: true
74
     * @var string
75
     */
76
    public $receivId;
77
    /**
78
     * The senderId
79
     * Meta information extracted from the WSDL
80
     * - nillable: true
81
     * @var string
82
     */
83
    public $senderId;
84
    /**
85
     * The redirection1Email
86
     * Meta information extracted from the WSDL
87
     * - nillable: true
88
     * @var string
89
     */
90
    public $redirection1Email;
91
    /**
92
     * The redirection2Email
93
     * Meta information extracted from the WSDL
94
     * - nillable: true
95
     * @var string
96
     */
97
    public $redirection2Email;
98
    /**
99
     * The redirection3Email
100
     * Meta information extracted from the WSDL
101
     * - nillable: true
102
     * @var string
103
     */
104
    public $redirection3Email;
105
    /**
106
     * The redirection4Email
107
     * Meta information extracted from the WSDL
108
     * - nillable: true
109
     * @var string
110
     */
111
    public $redirection4Email;
112
    /**
113
     * The redirection5Email
114
     * Meta information extracted from the WSDL
115
     * - nillable: true
116
     * @var string
117
     */
118
    public $redirection5Email;
119
    /**
120
     * Constructor method for telephonyFaxOptionsModify
121
     * @uses TelephonyFaxOptionsModify::setSession()
122
     * @uses TelephonyFaxOptionsModify::setNumber()
123
     * @uses TelephonyFaxOptionsModify::setCountry()
124
     * @uses TelephonyFaxOptionsModify::setFromName()
125
     * @uses TelephonyFaxOptionsModify::setFromEmail()
126
     * @uses TelephonyFaxOptionsModify::setFaxQuality()
127
     * @uses TelephonyFaxOptionsModify::setFaxTagLine()
128
     * @uses TelephonyFaxOptionsModify::setFaxMaxCall()
129
     * @uses TelephonyFaxOptionsModify::setReceivId()
130
     * @uses TelephonyFaxOptionsModify::setSenderId()
131
     * @uses TelephonyFaxOptionsModify::setRedirection1Email()
132
     * @uses TelephonyFaxOptionsModify::setRedirection2Email()
133
     * @uses TelephonyFaxOptionsModify::setRedirection3Email()
134
     * @uses TelephonyFaxOptionsModify::setRedirection4Email()
135
     * @uses TelephonyFaxOptionsModify::setRedirection5Email()
136
     * @param string $session
137
     * @param string $number
138
     * @param string $country
139
     * @param string $fromName
140
     * @param string $fromEmail
141
     * @param string $faxQuality
142
     * @param string $faxTagLine
143
     * @param int $faxMaxCall
144
     * @param string $receivId
145
     * @param string $senderId
146
     * @param string $redirection1Email
147
     * @param string $redirection2Email
148
     * @param string $redirection3Email
149
     * @param string $redirection4Email
150
     * @param string $redirection5Email
151
     */
152
    public function __construct($session = null, $number = null, $country = null, $fromName = null, $fromEmail = null, $faxQuality = null, $faxTagLine = null, $faxMaxCall = null, $receivId = null, $senderId = null, $redirection1Email = null, $redirection2Email = null, $redirection3Email = null, $redirection4Email = null, $redirection5Email = null)
153
    {
154
        $this
155
            ->setSession($session)
156
            ->setNumber($number)
157
            ->setCountry($country)
158
            ->setFromName($fromName)
159
            ->setFromEmail($fromEmail)
160
            ->setFaxQuality($faxQuality)
161
            ->setFaxTagLine($faxTagLine)
162
            ->setFaxMaxCall($faxMaxCall)
163
            ->setReceivId($receivId)
164
            ->setSenderId($senderId)
165
            ->setRedirection1Email($redirection1Email)
166
            ->setRedirection2Email($redirection2Email)
167
            ->setRedirection3Email($redirection3Email)
168
            ->setRedirection4Email($redirection4Email)
169
            ->setRedirection5Email($redirection5Email);
170
    }
171
    /**
172
     * Get session value
173
     * @return string|null
174
     */
175
    public function getSession()
176
    {
177
        return $this->session;
178
    }
179
    /**
180
     * Set session value
181
     * @param string $session
182
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
183
     */
184
    public function setSession($session = null)
185
    {
186
        // validation for constraint: string
187
        if (!is_null($session) && !is_string($session)) {
0 ignored issues
show
introduced by
The condition is_string($session) is always true.
Loading history...
188
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($session, true), gettype($session)), __LINE__);
189
        }
190
        $this->session = $session;
191
        return $this;
192
    }
193
    /**
194
     * Get number value
195
     * @return string|null
196
     */
197
    public function getNumber()
198
    {
199
        return $this->number;
200
    }
201
    /**
202
     * Set number value
203
     * @param string $number
204
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
205
     */
206
    public function setNumber($number = null)
207
    {
208
        // validation for constraint: string
209
        if (!is_null($number) && !is_string($number)) {
0 ignored issues
show
introduced by
The condition is_string($number) is always true.
Loading history...
210
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($number, true), gettype($number)), __LINE__);
211
        }
212
        $this->number = $number;
213
        return $this;
214
    }
215
    /**
216
     * Get country value
217
     * @return string|null
218
     */
219
    public function getCountry()
220
    {
221
        return $this->country;
222
    }
223
    /**
224
     * Set country value
225
     * @param string $country
226
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
227
     */
228
    public function setCountry($country = null)
229
    {
230
        // validation for constraint: string
231
        if (!is_null($country) && !is_string($country)) {
0 ignored issues
show
introduced by
The condition is_string($country) is always true.
Loading history...
232
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($country, true), gettype($country)), __LINE__);
233
        }
234
        $this->country = $country;
235
        return $this;
236
    }
237
    /**
238
     * Get fromName value
239
     * @return string|null
240
     */
241
    public function getFromName()
242
    {
243
        return $this->fromName;
244
    }
245
    /**
246
     * Set fromName value
247
     * @param string $fromName
248
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
249
     */
250
    public function setFromName($fromName = null)
251
    {
252
        // validation for constraint: string
253
        if (!is_null($fromName) && !is_string($fromName)) {
0 ignored issues
show
introduced by
The condition is_string($fromName) is always true.
Loading history...
254
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fromName, true), gettype($fromName)), __LINE__);
255
        }
256
        $this->fromName = $fromName;
257
        return $this;
258
    }
259
    /**
260
     * Get fromEmail value
261
     * @return string|null
262
     */
263
    public function getFromEmail()
264
    {
265
        return $this->fromEmail;
266
    }
267
    /**
268
     * Set fromEmail value
269
     * @param string $fromEmail
270
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
271
     */
272
    public function setFromEmail($fromEmail = null)
273
    {
274
        // validation for constraint: string
275
        if (!is_null($fromEmail) && !is_string($fromEmail)) {
0 ignored issues
show
introduced by
The condition is_string($fromEmail) is always true.
Loading history...
276
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($fromEmail, true), gettype($fromEmail)), __LINE__);
277
        }
278
        $this->fromEmail = $fromEmail;
279
        return $this;
280
    }
281
    /**
282
     * Get faxQuality value
283
     * @return string|null
284
     */
285
    public function getFaxQuality()
286
    {
287
        return $this->faxQuality;
288
    }
289
    /**
290
     * Set faxQuality value
291
     * @param string $faxQuality
292
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
293
     */
294
    public function setFaxQuality($faxQuality = null)
295
    {
296
        // validation for constraint: string
297
        if (!is_null($faxQuality) && !is_string($faxQuality)) {
0 ignored issues
show
introduced by
The condition is_string($faxQuality) is always true.
Loading history...
298
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($faxQuality, true), gettype($faxQuality)), __LINE__);
299
        }
300
        $this->faxQuality = $faxQuality;
301
        return $this;
302
    }
303
    /**
304
     * Get faxTagLine value
305
     * @return string|null
306
     */
307
    public function getFaxTagLine()
308
    {
309
        return $this->faxTagLine;
310
    }
311
    /**
312
     * Set faxTagLine value
313
     * @param string $faxTagLine
314
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
315
     */
316
    public function setFaxTagLine($faxTagLine = null)
317
    {
318
        // validation for constraint: string
319
        if (!is_null($faxTagLine) && !is_string($faxTagLine)) {
0 ignored issues
show
introduced by
The condition is_string($faxTagLine) is always true.
Loading history...
320
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($faxTagLine, true), gettype($faxTagLine)), __LINE__);
321
        }
322
        $this->faxTagLine = $faxTagLine;
323
        return $this;
324
    }
325
    /**
326
     * Get faxMaxCall value
327
     * @return int|null
328
     */
329
    public function getFaxMaxCall()
330
    {
331
        return $this->faxMaxCall;
332
    }
333
    /**
334
     * Set faxMaxCall value
335
     * @param int $faxMaxCall
336
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
337
     */
338
    public function setFaxMaxCall($faxMaxCall = null)
339
    {
340
        // validation for constraint: int
341
        if (!is_null($faxMaxCall) && !(is_int($faxMaxCall) || ctype_digit($faxMaxCall))) {
0 ignored issues
show
introduced by
The condition is_int($faxMaxCall) is always true.
Loading history...
342
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($faxMaxCall, true), gettype($faxMaxCall)), __LINE__);
343
        }
344
        $this->faxMaxCall = $faxMaxCall;
345
        return $this;
346
    }
347
    /**
348
     * Get receivId value
349
     * @return string|null
350
     */
351
    public function getReceivId()
352
    {
353
        return $this->receivId;
354
    }
355
    /**
356
     * Set receivId value
357
     * @param string $receivId
358
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
359
     */
360
    public function setReceivId($receivId = null)
361
    {
362
        // validation for constraint: string
363
        if (!is_null($receivId) && !is_string($receivId)) {
0 ignored issues
show
introduced by
The condition is_string($receivId) is always true.
Loading history...
364
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($receivId, true), gettype($receivId)), __LINE__);
365
        }
366
        $this->receivId = $receivId;
367
        return $this;
368
    }
369
    /**
370
     * Get senderId value
371
     * @return string|null
372
     */
373
    public function getSenderId()
374
    {
375
        return $this->senderId;
376
    }
377
    /**
378
     * Set senderId value
379
     * @param string $senderId
380
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
381
     */
382
    public function setSenderId($senderId = null)
383
    {
384
        // validation for constraint: string
385
        if (!is_null($senderId) && !is_string($senderId)) {
0 ignored issues
show
introduced by
The condition is_string($senderId) is always true.
Loading history...
386
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($senderId, true), gettype($senderId)), __LINE__);
387
        }
388
        $this->senderId = $senderId;
389
        return $this;
390
    }
391
    /**
392
     * Get redirection1Email value
393
     * @return string|null
394
     */
395
    public function getRedirection1Email()
396
    {
397
        return $this->redirection1Email;
398
    }
399
    /**
400
     * Set redirection1Email value
401
     * @param string $redirection1Email
402
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
403
     */
404
    public function setRedirection1Email($redirection1Email = null)
405
    {
406
        // validation for constraint: string
407
        if (!is_null($redirection1Email) && !is_string($redirection1Email)) {
0 ignored issues
show
introduced by
The condition is_string($redirection1Email) is always true.
Loading history...
408
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirection1Email, true), gettype($redirection1Email)), __LINE__);
409
        }
410
        $this->redirection1Email = $redirection1Email;
411
        return $this;
412
    }
413
    /**
414
     * Get redirection2Email value
415
     * @return string|null
416
     */
417
    public function getRedirection2Email()
418
    {
419
        return $this->redirection2Email;
420
    }
421
    /**
422
     * Set redirection2Email value
423
     * @param string $redirection2Email
424
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
425
     */
426
    public function setRedirection2Email($redirection2Email = null)
427
    {
428
        // validation for constraint: string
429
        if (!is_null($redirection2Email) && !is_string($redirection2Email)) {
0 ignored issues
show
introduced by
The condition is_string($redirection2Email) is always true.
Loading history...
430
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirection2Email, true), gettype($redirection2Email)), __LINE__);
431
        }
432
        $this->redirection2Email = $redirection2Email;
433
        return $this;
434
    }
435
    /**
436
     * Get redirection3Email value
437
     * @return string|null
438
     */
439
    public function getRedirection3Email()
440
    {
441
        return $this->redirection3Email;
442
    }
443
    /**
444
     * Set redirection3Email value
445
     * @param string $redirection3Email
446
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
447
     */
448
    public function setRedirection3Email($redirection3Email = null)
449
    {
450
        // validation for constraint: string
451
        if (!is_null($redirection3Email) && !is_string($redirection3Email)) {
0 ignored issues
show
introduced by
The condition is_string($redirection3Email) is always true.
Loading history...
452
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirection3Email, true), gettype($redirection3Email)), __LINE__);
453
        }
454
        $this->redirection3Email = $redirection3Email;
455
        return $this;
456
    }
457
    /**
458
     * Get redirection4Email value
459
     * @return string|null
460
     */
461
    public function getRedirection4Email()
462
    {
463
        return $this->redirection4Email;
464
    }
465
    /**
466
     * Set redirection4Email value
467
     * @param string $redirection4Email
468
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
469
     */
470
    public function setRedirection4Email($redirection4Email = null)
471
    {
472
        // validation for constraint: string
473
        if (!is_null($redirection4Email) && !is_string($redirection4Email)) {
0 ignored issues
show
introduced by
The condition is_string($redirection4Email) is always true.
Loading history...
474
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirection4Email, true), gettype($redirection4Email)), __LINE__);
475
        }
476
        $this->redirection4Email = $redirection4Email;
477
        return $this;
478
    }
479
    /**
480
     * Get redirection5Email value
481
     * @return string|null
482
     */
483
    public function getRedirection5Email()
484
    {
485
        return $this->redirection5Email;
486
    }
487
    /**
488
     * Set redirection5Email value
489
     * @param string $redirection5Email
490
     * @return \Ovh\StructType\TelephonyFaxOptionsModify
491
     */
492
    public function setRedirection5Email($redirection5Email = null)
493
    {
494
        // validation for constraint: string
495
        if (!is_null($redirection5Email) && !is_string($redirection5Email)) {
0 ignored issues
show
introduced by
The condition is_string($redirection5Email) is always true.
Loading history...
496
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($redirection5Email, true), gettype($redirection5Email)), __LINE__);
497
        }
498
        $this->redirection5Email = $redirection5Email;
499
        return $this;
500
    }
501
}
502