Completed
Push — master ( 54c69f...d7a840 )
by Joshua
10:29
created

PhoneMetadata::hasSameMobileAndFixedLinePattern()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace libphonenumber;
4
5
/**
6
 * Class PhoneMetadata
7
 * @package libphonenumber
8
 * @internal Used internally, and can change at any time
9
 */
10
class PhoneMetadata
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $id = null;
16
    /**
17
     * @var int
18
     */
19
    protected $countryCode = null;
20
    protected $leadingDigits = null;
21
    protected $internationalPrefix = null;
22
    protected $preferredInternationalPrefix = null;
23
    protected $nationalPrefixForParsing = null;
24
    protected $nationalPrefixTransformRule = null;
25
    protected $nationalPrefix = null;
26
    protected $preferredExtnPrefix = null;
27
    protected $mainCountryForCode = false;
28
    protected $leadingZeroPossible = false;
29
    protected $mobileNumberPortableRegion = false;
30
    protected $generalDesc = null;
31
    /**
32
     * @var PhoneNumberDesc
33
     */
34
    protected $mobile = null;
35
    protected $premiumRate = null;
36
    protected $fixedLine = null;
37
    protected $sameMobileAndFixedLinePattern = false;
38
    protected $numberFormat = array();
39
    protected $tollFree = null;
40
    protected $sharedCost = null;
41
    protected $personalNumber;
42
    protected $voip;
43
    protected $pager;
44
    protected $uan;
45
    protected $emergency;
46
    protected $voicemail;
47
    /**
48
     * @var PhoneNumberDesc
49
     */
50
    protected $short_code;
51
    /**
52
     * @var PhoneNumberDesc
53
     */
54
    protected $standard_rate;
55
    /**
56
     * @var PhoneNumberDesc
57
     */
58
    protected $carrierSpecific;
59
    /**
60
     * @var PhoneNumberDesc
61
     */
62
    protected $smsServices;
63
    /**
64
     * @var PhoneNumberDesc
65
     */
66
    protected $noInternationalDialling = null;
67
    /**
68
     *
69
     * @var NumberFormat[]
70
     */
71
    protected $intlNumberFormat = array();
72
73
    /**
74
     * @return boolean
75
     */
76
    public function hasId()
77
    {
78
        return isset($this->id);
79
    }
80 482
81
    /**
82 482
     * @return boolean
83
     */
84
    public function hasCountryCode()
85 482
    {
86
        return isset($this->countryCode);
87 482
    }
88
89
    public function hasInternationalPrefix()
90
    {
91
        return isset($this->internationalPrefix);
92
    }
93
94
    public function hasMainCountryForCode()
95 2
    {
96
        return isset($this->mainCountryForCode);
97 2
    }
98
99
    public function isMainCountryForCode()
100 482
    {
101
        return $this->mainCountryForCode;
102 482
    }
103
104
    public function getMainCountryForCode()
105 1569
    {
106
        return $this->mainCountryForCode;
107 1569
    }
108 1569
109
    public function setMainCountryForCode($value)
110
    {
111 1
        $this->mainCountryForCode = $value;
112
        return $this;
113 1
    }
114 1
115
    public function clearMainCountryForCode()
116
    {
117 482
        $this->mainCountryForCode = false;
118
        return $this;
119 482
    }
120
121
    public function hasLeadingZeroPossible()
122 482
    {
123
        return isset($this->leadingZeroPossible);
124 482
    }
125
126
    public function hasMobileNumberPortableRegion()
127 483
    {
128
        return isset($this->mobileNumberPortableRegion);
129 483
    }
130
131
    public function hasSameMobileAndFixedLinePattern()
132 2
    {
133
        return isset($this->sameMobileAndFixedLinePattern);
134 2
    }
135
136
    public function numberFormatSize()
137
    {
138
        return count($this->numberFormat);
139
    }
140
141 11
    /**
142
     * @param int $index
143 11
     * @return NumberFormat
144
     */
145
    public function getNumberFormat($index)
146 27
    {
147
        return $this->numberFormat[$index];
148 27
    }
149
150
    public function intlNumberFormatSize()
151 6
    {
152
        return count($this->intlNumberFormat);
153 6
    }
154
155
    public function getIntlNumberFormat($index)
156 7
    {
157
        return $this->intlNumberFormat[$index];
158 7
    }
159 7
160
    public function clearIntlNumberFormat()
161
    {
162 482
        $this->intlNumberFormat = array();
163
        return $this;
164 482
    }
165
166 482
    public function toArray()
167 482
    {
168
        $output = array();
169
170 482
        if ($this->hasGeneralDesc()) {
171 244
            $output['generalDesc'] = $this->getGeneralDesc()->toArray();
172
        }
173
174 482
        if ($this->hasFixedLine()) {
175 244
            $output['fixedLine'] = $this->getFixedLine()->toArray();
176
        }
177
178 482
        if ($this->hasMobile()) {
179 482
            $output['mobile'] = $this->getMobile()->toArray();
180
        }
181
182 482
        if ($this->hasTollFree()) {
183 482
            $output['tollFree'] = $this->getTollFree()->toArray();
184
        }
185
186 482
        if ($this->hasPremiumRate()) {
187 482
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
188
        }
189
190 482
        if ($this->hasPremiumRate()) {
191 244
            $output['premiumRate'] = $this->getPremiumRate()->toArray();
192
        }
193
194 482
        if ($this->hasSharedCost()) {
195 244
            $output['sharedCost'] = $this->getSharedCost()->toArray();
196
        }
197
198 482
        if ($this->hasPersonalNumber()) {
199 244
            $output['personalNumber'] = $this->getPersonalNumber()->toArray();
200
        }
201
202 482
        if ($this->hasVoip()) {
203 244
            $output['voip'] = $this->getVoip()->toArray();
204
        }
205
206 482
        if ($this->hasPager()) {
207 244
            $output['pager'] = $this->getPager()->toArray();
208
        }
209
210 482
        if ($this->hasUan()) {
211 238
            $output['uan'] = $this->getUan()->toArray();
212
        }
213
214 482
        if ($this->hasEmergency()) {
215 244
            $output['emergency'] = $this->getEmergency()->toArray();
216
        }
217
218 482
        if ($this->hasVoicemail()) {
219 238
            $output['voicemail'] = $this->getVoicemail()->toArray();
220
        }
221
222 482
        if ($this->hasShortCode()) {
223 238
            $output['shortCode'] = $this->getShortCode()->toArray();
224
        }
225
226 482
        if ($this->hasStandardRate()) {
227 238
            $output['standardRate'] = $this->getStandardRate()->toArray();
228
        }
229
230 482
        if ($this->hasCarrierSpecific()) {
231 244
            $output['carrierSpecific'] = $this->getCarrierSpecific()->toArray();
232
        }
233
234 482
        if ($this->hasSmsServices()) {
235 482
            $output['smsServices'] = $this->getSmsServices()->toArray();
236 482
        }
237
238
        if ($this->hasNoInternationalDialling()) {
239 482
            $output['noInternationalDialling'] = $this->getNoInternationalDialling()->toArray();
240 482
        }
241
242
        $output['id'] = $this->getId();
243 482
        if ($this->hasCountryCode()) {
244 22
            $output['countryCode'] = $this->getCountryCode();
245
        }
246
247 482
        if ($this->hasInternationalPrefix()) {
248 146
            $output['internationalPrefix'] = $this->getInternationalPrefix();
249
        }
250
251 482
        if ($this->hasPreferredInternationalPrefix()) {
252 8
            $output['preferredInternationalPrefix'] = $this->getPreferredInternationalPrefix();
0 ignored issues
show
Bug introduced by
Are you sure the assignment to $output['preferredInternationalPrefix'] is correct as $this->getPreferredInternationalPrefix() (which targets libphonenumber\PhoneMeta...edInternationalPrefix()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
253
        }
254
255 482
        if ($this->hasNationalPrefix()) {
256 151
            $output['nationalPrefix'] = $this->getNationalPrefix();
257
        }
258
259 482
        if ($this->hasPreferredExtnPrefix()) {
260 4
            $output['preferredExtnPrefix'] = $this->getPreferredExtnPrefix();
261
        }
262
263 482
        if ($this->hasNationalPrefixForParsing()) {
264 482
            $output['nationalPrefixForParsing'] = $this->getNationalPrefixForParsing();
265
        }
266
267 482
        if ($this->hasNationalPrefixTransformRule()) {
268 482
            $output['nationalPrefixTransformRule'] = $this->getNationalPrefixTransformRule();
269 198
        }
270
271
        if ($this->hasSameMobileAndFixedLinePattern()) {
272 482
            $output['sameMobileAndFixedLinePattern'] = $this->getSameMobileAndFixedLinePattern();
273 482
        }
274 15
275
        $output['numberFormat'] = array();
276
        foreach ($this->numberFormats() as $numberFormat) {
277 482
            $output['numberFormat'][] = $numberFormat->toArray();
278
        }
279 482
280 26
        $output['intlNumberFormat'] = array();
281
        foreach ($this->intlNumberFormats() as $intlNumberFormat) {
282
            $output['intlNumberFormat'][] = $intlNumberFormat->toArray();
283 482
        }
284 482
285
        $output['mainCountryForCode'] = $this->getMainCountryForCode();
286
287 482
        if ($this->hasLeadingDigits()) {
288 482
            $output['leadingDigits'] = $this->getLeadingDigits();
289
        }
290
291 482
        if ($this->hasLeadingZeroPossible()) {
292
            $output['leadingZeroPossible'] = $this->isLeadingZeroPossible();
293
        }
294 485
295
        if ($this->hasMobileNumberPortableRegion()) {
296 485
            $output['mobileNumberPortableRegion'] = $this->isMobileNumberPortableRegion();
297
        }
298
299
        return $output;
300
    }
301
302 3509
    public function hasGeneralDesc()
303
    {
304 3509
        return isset($this->generalDesc);
305
    }
306
307 1577
    /**
308
     * @return PhoneNumberDesc
309 1577
     */
310 1577
    public function getGeneralDesc()
311
    {
312
        return $this->generalDesc;
313 485
    }
314
315 485
    public function setGeneralDesc(PhoneNumberDesc $value)
316
    {
317
        $this->generalDesc = $value;
318
        return $this;
319
    }
320
321 1860
    public function hasFixedLine()
322
    {
323 1860
        return isset($this->fixedLine);
324
    }
325
326 1084
    /**
327
     * @return PhoneNumberDesc
328 1084
     */
329 1084
    public function getFixedLine()
330
    {
331
        return $this->fixedLine;
332 485
    }
333
334 485
    public function setFixedLine(PhoneNumberDesc $value)
335
    {
336
        $this->fixedLine = $value;
337
        return $this;
338
    }
339
340 1472
    public function hasMobile()
341
    {
342 1472
        return isset($this->mobile);
343
    }
344
345 1084
    /**
346
     * @return PhoneNumberDesc
347 1084
     */
348 1084
    public function getMobile()
349
    {
350
        return $this->mobile;
351 485
    }
352
353 485
    public function setMobile(PhoneNumberDesc $value)
354
    {
355
        $this->mobile = $value;
356
        return $this;
357
    }
358
359 2729
    public function hasTollFree()
360
    {
361 2729
        return isset($this->tollFree);
362
    }
363
364 1574
    /**
365
     * @return PhoneNumberDesc
366 1574
     */
367 1574
    public function getTollFree()
368
    {
369
        return $this->tollFree;
370 485
    }
371
372 485
    public function setTollFree(PhoneNumberDesc $value)
373
    {
374
        $this->tollFree = $value;
375
        return $this;
376
    }
377
378 2978
    public function hasPremiumRate()
379
    {
380 2978
        return isset($this->premiumRate);
381
    }
382
383 1574
    /**
384
     * @return PhoneNumberDesc
385 1574
     */
386 1574
    public function getPremiumRate()
387
    {
388
        return $this->premiumRate;
389 485
    }
390
391 485
    public function setPremiumRate(PhoneNumberDesc $value)
392
    {
393
        $this->premiumRate = $value;
394
        return $this;
395
    }
396
397 1938
    public function hasSharedCost()
398
    {
399 1938
        return isset($this->sharedCost);
400
    }
401
402 1084
    /**
403
     * @return PhoneNumberDesc
404 1084
     */
405 1084
    public function getSharedCost()
406
    {
407
        return $this->sharedCost;
408 485
    }
409
410 485
    public function setSharedCost(PhoneNumberDesc $value)
411
    {
412
        $this->sharedCost = $value;
413
        return $this;
414
    }
415
416 1790
    public function hasPersonalNumber()
417
    {
418 1790
        return isset($this->personalNumber);
419
    }
420
421 1084
    /**
422
     * @return PhoneNumberDesc
423 1084
     */
424 1084
    public function getPersonalNumber()
425
    {
426
        return $this->personalNumber;
427 485
    }
428
429 485
    public function setPersonalNumber(PhoneNumberDesc $value)
430
    {
431
        $this->personalNumber = $value;
432
        return $this;
433
    }
434
435 1855
    public function hasVoip()
436
    {
437 1855
        return isset($this->voip);
438
    }
439
440 1084
    /**
441
     * @return PhoneNumberDesc
442 1084
     */
443 1084
    public function getVoip()
444
    {
445
        return $this->voip;
446 485
    }
447
448 485
    public function setVoip(PhoneNumberDesc $value)
449
    {
450
        $this->voip = $value;
451
        return $this;
452
    }
453
454 1764
    public function hasPager()
455
    {
456 1764
        return isset($this->pager);
457
    }
458
459 1084
    /**
460
     * @return PhoneNumberDesc
461 1084
     */
462 1084
    public function getPager()
463
    {
464
        return $this->pager;
465 485
    }
466
467 485
    public function setPager(PhoneNumberDesc $value)
468
    {
469
        $this->pager = $value;
470
        return $this;
471
    }
472
473 1717
    public function hasUan()
474
    {
475 1717
        return isset($this->uan);
476
    }
477
478 1084
    /**
479
     * @return PhoneNumberDesc
480 1084
     */
481 1084
    public function getUan()
482
    {
483
        return $this->uan;
484 745
    }
485
486 745
    public function setUan(PhoneNumberDesc $value)
487
    {
488
        $this->uan = $value;
489
        return $this;
490
    }
491
492 499
    public function hasEmergency()
493
    {
494 499
        return isset($this->emergency);
495
    }
496
497 498
    /**
498
     * @return PhoneNumberDesc
499 498
     */
500 498
    public function getEmergency()
501
    {
502
        return $this->emergency;
503 485
    }
504
505 485
    public function setEmergency(PhoneNumberDesc $value)
506
    {
507
        $this->emergency = $value;
508
        return $this;
509
    }
510
511 1703
    public function hasVoicemail()
512
    {
513 1703
        return isset($this->voicemail);
514
    }
515
516 1084
    /**
517
     * @return PhoneNumberDesc
518 1084
     */
519 1084
    public function getVoicemail()
520
    {
521
        return $this->voicemail;
522 485
    }
523
524 485
    public function setVoicemail(PhoneNumberDesc $value)
525
    {
526
        $this->voicemail = $value;
527 484
        return $this;
528
    }
529 484
530
    public function hasShortCode()
531
    {
532 498
        return isset($this->short_code);
533
    }
534 498
535 498
    public function getShortCode()
536
    {
537
        return $this->short_code;
538 485
    }
539
540 485
    public function setShortCode(PhoneNumberDesc $value)
541
    {
542
        $this->short_code = $value;
543 769
        return $this;
544
    }
545 769
546
    public function hasStandardRate()
547
    {
548 498
        return isset($this->standard_rate);
549
    }
550 498
551 498
    public function getStandardRate()
552
    {
553
        return $this->standard_rate;
554 485
    }
555
556 485
    public function setStandardRate(PhoneNumberDesc $value)
557
    {
558
        $this->standard_rate = $value;
559 478
        return $this;
560
    }
561 478
562
    public function hasCarrierSpecific()
563
    {
564 498
        return isset($this->carrierSpecific);
565
    }
566 498
567 498
    public function getCarrierSpecific()
568
    {
569
        return $this->carrierSpecific;
570 485
    }
571
572 485
    public function setCarrierSpecific(PhoneNumberDesc $value)
573
    {
574
        $this->carrierSpecific = $value;
575 493
        return $this;
576
    }
577 493
578
    public function hasSmsServices()
579
    {
580 1084
        return isset($this->smsServices);
581
    }
582 1084
583 1084
    public function getSmsServices()
584
    {
585
        return $this->smsServices;
586
    }
587
588
    public function setSmsServices(PhoneNumberDesc $value)
589 497
    {
590
        $this->smsServices = $value;
591 497
        return $this;
592
    }
593
594
    public function hasNoInternationalDialling()
595
    {
596
        return isset($this->noInternationalDialling);
597
    }
598 1578
599
    public function getNoInternationalDialling()
600 1578
    {
601 1578
        return $this->noInternationalDialling;
602
    }
603
604
    public function setNoInternationalDialling(PhoneNumberDesc $value)
605
    {
606
        $this->noInternationalDialling = $value;
607 3477
        return $this;
608
    }
609 3477
610
    /**
611
     * @return string
612
     */
613
    public function getId()
614
    {
615
        return $this->id;
616 1578
    }
617
618 1578
    /**
619 1578
     * @param string $value
620
     * @return PhoneMetadata
621
     */
622 3475
    public function setId($value)
623
    {
624 3475
        $this->id = $value;
625
        return $this;
626
    }
627 1578
628
    /**
629 1578
     * @return int
630 1578
     */
631
    public function getCountryCode()
632
    {
633 485
        return $this->countryCode;
634
    }
635 485
636
    /**
637
     * @param int $value
638 27
     * @return PhoneMetadata
639
     */
640 27
    public function setCountryCode($value)
641
    {
642
        $this->countryCode = $value;
643 91
        return $this;
644
    }
645 91
646 91
    public function getInternationalPrefix()
647
    {
648
        return $this->internationalPrefix;
649 1
    }
650
651 1
    public function setInternationalPrefix($value)
652 1
    {
653
        $this->internationalPrefix = $value;
654
        return $this;
655 515
    }
656
657 515
    public function hasPreferredInternationalPrefix()
658
    {
659
        return ($this->preferredInternationalPrefix !== null);
660 179
    }
661
662 179
    public function getPreferredInternationalPrefix()
663
    {
664
        return $this->preferredInternationalPrefix;
665 755
    }
666
667 755
    public function setPreferredInternationalPrefix($value)
668 755
    {
669
        $this->preferredInternationalPrefix = $value;
670
        return $this;
671
    }
672
673
    public function clearPreferredInternationalPrefix()
674
    {
675
        $this->preferredInternationalPrefix = null;
676
        return $this;
677 485
    }
678
679 485
    public function hasNationalPrefix()
680
    {
681
        return isset($this->nationalPrefix);
682 11
    }
683
684 11
    public function getNationalPrefix()
685
    {
686
        return $this->nationalPrefix;
687 201
    }
688
689 201
    public function setNationalPrefix($value)
690 201
    {
691
        $this->nationalPrefix = $value;
692
        return $this;
693 1
    }
694
695 1
    public function clearNationalPrefix()
696 1
    {
697
        $this->nationalPrefix = '';
698
        return $this;
699 511
    }
700
701 511
    public function hasPreferredExtnPrefix()
702
    {
703
        return isset($this->preferredExtnPrefix);
704 3147
    }
705
706 3147
    public function getPreferredExtnPrefix()
707
    {
708
        return $this->preferredExtnPrefix;
709 772
    }
710
711 772
    public function setPreferredExtnPrefix($value)
712 772
    {
713
        $this->preferredExtnPrefix = $value;
714
        return $this;
715 482
    }
716
717 482
    public function clearPreferredExtnPrefix()
718
    {
719
        $this->preferredExtnPrefix = '';
720 147
        return $this;
721
    }
722 147
723
    public function hasNationalPrefixForParsing()
724
    {
725 52
        return isset($this->nationalPrefixForParsing);
726
    }
727 52
728 52
    public function getNationalPrefixForParsing()
729
    {
730
        return $this->nationalPrefixForParsing;
731 1
    }
732
733 1
    public function setNationalPrefixForParsing($value)
734 1
    {
735
        $this->nationalPrefixForParsing = $value;
736
        return $this;
737 1684
    }
738
739 1684
    public function hasNationalPrefixTransformRule()
740
    {
741
        return isset($this->nationalPrefixTransformRule);
742 5
    }
743
744 5
    public function getNationalPrefixTransformRule()
745 5
    {
746
        return $this->nationalPrefixTransformRule;
747
    }
748 1
749
    public function setNationalPrefixTransformRule($value)
750 1
    {
751 1
        $this->nationalPrefixTransformRule = $value;
752
        return $this;
753
    }
754
755
    public function clearNationalPrefixTransformRule()
756
    {
757 632
        $this->nationalPrefixTransformRule = '';
758
        return $this;
759 632
    }
760
761
    public function getSameMobileAndFixedLinePattern()
762 589
    {
763
        return $this->sameMobileAndFixedLinePattern;
764 589
    }
765
766
    public function setSameMobileAndFixedLinePattern($value)
767
    {
768
        $this->sameMobileAndFixedLinePattern = $value;
769
        return $this;
770 1078
    }
771
772 1078
    public function clearSameMobileAndFixedLinePattern()
773
    {
774
        $this->sameMobileAndFixedLinePattern = false;
775 201
        return $this;
776
    }
777 201
778
    /**
779
     * @return NumberFormat[]
780 80
     */
781
    public function numberFormats()
782 80
    {
783 80
        return $this->numberFormat;
784
    }
785
786 486
    public function intlNumberFormats()
787
    {
788 486
        return $this->intlNumberFormat;
789
    }
790
791 1569
    /**
792
     * @return bool
793 1569
     */
794 1569
    public function hasLeadingDigits()
795
    {
796
        return isset($this->leadingDigits);
797 1
    }
798
799 1
    public function getLeadingDigits()
800 1
    {
801
        return $this->leadingDigits;
802
    }
803 487
804
    public function setLeadingDigits($value)
805 487
    {
806
        $this->leadingDigits = $value;
807
        return $this;
808 1569
    }
809
810 1569
    public function isLeadingZeroPossible()
811 1569
    {
812
        return $this->leadingZeroPossible;
813
    }
814 1
815
    public function setLeadingZeroPossible($value)
816 1
    {
817 1
        $this->leadingZeroPossible = $value;
818
        return $this;
819
    }
820
821
    public function clearLeadingZeroPossible()
822
    {
823
        $this->leadingZeroPossible = false;
824 1568
        return $this;
825
    }
826 1568
827 1568
    public function isMobileNumberPortableRegion()
828 1568
    {
829
        return $this->mobileNumberPortableRegion;
830
    }
831 1568
832 1079
    public function setMobileNumberPortableRegion($value)
833 1079
    {
834
        $this->mobileNumberPortableRegion = $value;
835
        return $this;
836 1568
    }
837 1079
838 1079
    public function clearMobileNumberPortableRegion()
839
    {
840
        $this->mobileNumberPortableRegion = false;
841 1568
        return $this;
842 1568
    }
843 1568
844
    /**
845
     * @param array $input
846 1568
     * @return PhoneMetadata
847 1568
     */
848 1568
    public function fromArray(array $input)
849
    {
850
        if (isset($input['generalDesc'])) {
851 1568
            $desc = new PhoneNumberDesc();
852 1079
            $this->setGeneralDesc($desc->fromArray($input['generalDesc']));
853 1079
        }
854
855
        if (isset($input['fixedLine'])) {
856 1568
            $desc = new PhoneNumberDesc();
857 1079
            $this->setFixedLine($desc->fromArray($input['fixedLine']));
858 1079
        }
859
860
        if (isset($input['mobile'])) {
861 1568
            $desc = new PhoneNumberDesc();
862 1079
            $this->setMobile($desc->fromArray($input['mobile']));
863 1079
        }
864
865
        if (isset($input['tollFree'])) {
866 1568
            $desc = new PhoneNumberDesc();
867 1079
            $this->setTollFree($desc->fromArray($input['tollFree']));
868 1079
        }
869
870
        if (isset($input['premiumRate'])) {
871 1568
            $desc = new PhoneNumberDesc();
872 1079
            $this->setPremiumRate($desc->fromArray($input['premiumRate']));
873 1079
        }
874
875
        if (isset($input['sharedCost'])) {
876 1568
            $desc = new PhoneNumberDesc();
877 497
            $this->setSharedCost($desc->fromArray($input['sharedCost']));
878 497
        }
879
880
        if (isset($input['personalNumber'])) {
881 1568
            $desc = new PhoneNumberDesc();
882 1079
            $this->setPersonalNumber($desc->fromArray($input['personalNumber']));
883 1079
        }
884
885
        if (isset($input['voip'])) {
886 1568
            $desc = new PhoneNumberDesc();
887 497
            $this->setVoip($desc->fromArray($input['voip']));
888 497
        }
889
890
        if (isset($input['pager'])) {
891 1568
            $desc = new PhoneNumberDesc();
892 497
            $this->setPager($desc->fromArray($input['pager']));
893 497
        }
894
895
        if (isset($input['uan'])) {
896 1568
            $desc = new PhoneNumberDesc();
897 497
            $this->setUan($desc->fromArray($input['uan']));
898 497
        }
899
900
        if (isset($input['emergency'])) {
901 1568
            $desc = new PhoneNumberDesc();
902 1079
            $this->setEmergency($desc->fromArray($input['emergency']));
903 1079
        }
904
905
        if (isset($input['voicemail'])) {
906 1568
            $desc = new PhoneNumberDesc();
907 1568
            $this->setVoicemail($desc->fromArray($input['voicemail']));
908 1568
        }
909
910 1568
        if (isset($input['shortCode'])) {
911 90
            $desc = new PhoneNumberDesc();
912
            $this->setShortCode(($desc->fromArray($input['shortCode'])));
913 1568
        }
914 752
915
        if (isset($input['standardRate'])) {
916 1568
            $desc = new PhoneNumberDesc();
917 752
            $this->setStandardRate($desc->fromArray($input['standardRate']));
918
        }
919
920 1568
        if (isset($input['carrierSpecific'])) {
921 200
            $desc = new PhoneNumberDesc();
922
            $this->setCarrierSpecific($desc->fromArray($input['carrierSpecific']));
923
        }
924 1568
925 768
        if (isset($input['smsServices'])) {
926
            $desc = new PhoneNumberDesc();
927
            $this->setSmsServices($desc->fromArray($input['smsServices']));
928 1568
        }
929 50
930
        if (isset($input['noInternationalDialling'])) {
931
            $desc = new PhoneNumberDesc();
932 1568
            $this->setNoInternationalDialling($desc->fromArray($input['noInternationalDialling']));
933 975
        }
934 975
935 975
        $this->setId($input['id']);
936
        $this->setCountryCode($input['countryCode']);
937
        $this->setInternationalPrefix($input['internationalPrefix']);
938 1568
939 259
        if (isset($input['preferredInternationalPrefix'])) {
940 259
            $this->setPreferredInternationalPrefix($input['preferredInternationalPrefix']);
941 259
        }
942
        if (isset($input['nationalPrefix'])) {
943
            $this->setNationalPrefix($input['nationalPrefix']);
944 1568
        }
945
        if (isset($input['nationalPrefix'])) {
946 1568
            $this->setNationalPrefix($input['nationalPrefix']);
947 79
        }
948
949
        if (isset($input['preferredExtnPrefix'])) {
950 1568
            $this->setPreferredExtnPrefix($input['preferredExtnPrefix']);
951 1568
        }
952
953
        if (isset($input['nationalPrefixForParsing'])) {
954 1568
            $this->setNationalPrefixForParsing($input['nationalPrefixForParsing']);
955 1568
        }
956
957
        if (isset($input['nationalPrefixTransformRule'])) {
958 1568
            $this->setNationalPrefixTransformRule($input['nationalPrefixTransformRule']);
959
        }
960
961 983
        foreach ($input['numberFormat'] as $numberFormatElt) {
962
            $numberFormat = new NumberFormat();
963 983
            $numberFormat->fromArray($numberFormatElt);
964 983
            $this->addNumberFormat($numberFormat);
965
        }
966
967 271
        foreach ($input['intlNumberFormat'] as $intlNumberFormatElt) {
968
            $numberFormat = new NumberFormat();
969 271
            $numberFormat->fromArray($intlNumberFormatElt);
970 271
            $this->addIntlNumberFormat($numberFormat);
971
        }
972
973
        $this->setMainCountryForCode($input['mainCountryForCode']);
974
975
        if (isset($input['leadingDigits'])) {
976
            $this->setLeadingDigits($input['leadingDigits']);
977
        }
978
979
        if (isset($input['leadingZeroPossible'])) {
980
            $this->setLeadingZeroPossible($input['leadingZeroPossible']);
981
        }
982
983
        if (isset($input['mobileNumberPortableRegion'])) {
984
            $this->setMobileNumberPortableRegion($input['mobileNumberPortableRegion']);
985
        }
986
987
        return $this;
988
    }
989
990
    public function addNumberFormat(NumberFormat $value)
991
    {
992
        $this->numberFormat[] = $value;
993
        return $this;
994
    }
995
996
    public function addIntlNumberFormat(NumberFormat $value)
997
    {
998
        $this->intlNumberFormat[] = $value;
999
        return $this;
1000
    }
1001
}
1002