Complex classes like PhoneMetadata 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 PhoneMetadata, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 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() |
||
| 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() |
||
| 103 | |||
| 104 | public function getMainCountryForCode() |
||
| 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() |
||
| 125 | |||
| 126 | public function hasMobileNumberPortableRegion() |
||
| 130 | |||
| 131 | public function hasSameMobileAndFixedLinePattern() |
||
| 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) |
||
| 149 | |||
| 150 | public function intlNumberFormatSize() |
||
| 154 | |||
| 155 | public function getIntlNumberFormat($index) |
||
| 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(); |
|
|
|
|||
| 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() |
|
| 306 | |||
| 307 | 1577 | /** |
|
| 308 | * @return PhoneNumberDesc |
||
| 309 | 1577 | */ |
|
| 310 | 1577 | public function getGeneralDesc() |
|
| 314 | |||
| 315 | 485 | public function setGeneralDesc(PhoneNumberDesc $value) |
|
| 316 | { |
||
| 317 | $this->generalDesc = $value; |
||
| 318 | return $this; |
||
| 319 | } |
||
| 320 | |||
| 321 | 1860 | public function hasFixedLine() |
|
| 325 | |||
| 326 | 1084 | /** |
|
| 327 | * @return PhoneNumberDesc |
||
| 328 | 1084 | */ |
|
| 329 | 1084 | public function getFixedLine() |
|
| 333 | |||
| 334 | 485 | public function setFixedLine(PhoneNumberDesc $value) |
|
| 335 | { |
||
| 336 | $this->fixedLine = $value; |
||
| 337 | return $this; |
||
| 338 | } |
||
| 339 | |||
| 340 | 1472 | public function hasMobile() |
|
| 344 | |||
| 345 | 1084 | /** |
|
| 346 | * @return PhoneNumberDesc |
||
| 347 | 1084 | */ |
|
| 348 | 1084 | public function getMobile() |
|
| 352 | |||
| 353 | 485 | public function setMobile(PhoneNumberDesc $value) |
|
| 354 | { |
||
| 355 | $this->mobile = $value; |
||
| 356 | return $this; |
||
| 357 | } |
||
| 358 | |||
| 359 | 2729 | public function hasTollFree() |
|
| 363 | |||
| 364 | 1574 | /** |
|
| 365 | * @return PhoneNumberDesc |
||
| 366 | 1574 | */ |
|
| 367 | 1574 | public function getTollFree() |
|
| 371 | |||
| 372 | 485 | public function setTollFree(PhoneNumberDesc $value) |
|
| 373 | { |
||
| 374 | $this->tollFree = $value; |
||
| 375 | return $this; |
||
| 376 | } |
||
| 377 | |||
| 378 | 2978 | public function hasPremiumRate() |
|
| 382 | |||
| 383 | 1574 | /** |
|
| 384 | * @return PhoneNumberDesc |
||
| 385 | 1574 | */ |
|
| 386 | 1574 | public function getPremiumRate() |
|
| 390 | |||
| 391 | 485 | public function setPremiumRate(PhoneNumberDesc $value) |
|
| 392 | { |
||
| 393 | $this->premiumRate = $value; |
||
| 394 | return $this; |
||
| 395 | } |
||
| 396 | |||
| 397 | 1938 | public function hasSharedCost() |
|
| 401 | |||
| 402 | 1084 | /** |
|
| 403 | * @return PhoneNumberDesc |
||
| 404 | 1084 | */ |
|
| 405 | 1084 | public function getSharedCost() |
|
| 409 | |||
| 410 | 485 | public function setSharedCost(PhoneNumberDesc $value) |
|
| 411 | { |
||
| 412 | $this->sharedCost = $value; |
||
| 413 | return $this; |
||
| 414 | } |
||
| 415 | |||
| 416 | 1790 | public function hasPersonalNumber() |
|
| 420 | |||
| 421 | 1084 | /** |
|
| 422 | * @return PhoneNumberDesc |
||
| 423 | 1084 | */ |
|
| 424 | 1084 | public function getPersonalNumber() |
|
| 428 | |||
| 429 | 485 | public function setPersonalNumber(PhoneNumberDesc $value) |
|
| 430 | { |
||
| 431 | $this->personalNumber = $value; |
||
| 432 | return $this; |
||
| 433 | } |
||
| 434 | |||
| 435 | 1855 | public function hasVoip() |
|
| 439 | |||
| 440 | 1084 | /** |
|
| 441 | * @return PhoneNumberDesc |
||
| 442 | 1084 | */ |
|
| 443 | 1084 | public function getVoip() |
|
| 447 | |||
| 448 | 485 | public function setVoip(PhoneNumberDesc $value) |
|
| 449 | { |
||
| 450 | $this->voip = $value; |
||
| 451 | return $this; |
||
| 452 | } |
||
| 453 | |||
| 454 | 1764 | public function hasPager() |
|
| 458 | |||
| 459 | 1084 | /** |
|
| 460 | * @return PhoneNumberDesc |
||
| 461 | 1084 | */ |
|
| 462 | 1084 | public function getPager() |
|
| 466 | |||
| 467 | 485 | public function setPager(PhoneNumberDesc $value) |
|
| 468 | { |
||
| 469 | $this->pager = $value; |
||
| 470 | return $this; |
||
| 471 | } |
||
| 472 | |||
| 473 | 1717 | public function hasUan() |
|
| 477 | |||
| 478 | 1084 | /** |
|
| 479 | * @return PhoneNumberDesc |
||
| 480 | 1084 | */ |
|
| 481 | 1084 | public function getUan() |
|
| 485 | |||
| 486 | 745 | public function setUan(PhoneNumberDesc $value) |
|
| 487 | { |
||
| 488 | $this->uan = $value; |
||
| 489 | return $this; |
||
| 490 | } |
||
| 491 | |||
| 492 | 499 | public function hasEmergency() |
|
| 496 | |||
| 497 | 498 | /** |
|
| 498 | * @return PhoneNumberDesc |
||
| 499 | 498 | */ |
|
| 500 | 498 | public function getEmergency() |
|
| 504 | |||
| 505 | 485 | public function setEmergency(PhoneNumberDesc $value) |
|
| 506 | { |
||
| 507 | $this->emergency = $value; |
||
| 508 | return $this; |
||
| 509 | } |
||
| 510 | |||
| 511 | 1703 | public function hasVoicemail() |
|
| 515 | |||
| 516 | 1084 | /** |
|
| 517 | * @return PhoneNumberDesc |
||
| 518 | 1084 | */ |
|
| 519 | 1084 | public function getVoicemail() |
|
| 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() |
|
| 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() |
|
| 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() |
|
| 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() |
||
| 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() |
|
| 650 | |||
| 651 | 1 | public function setInternationalPrefix($value) |
|
| 656 | |||
| 657 | 515 | public function hasPreferredInternationalPrefix() |
|
| 661 | |||
| 662 | 179 | public function getPreferredInternationalPrefix() |
|
| 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() |
|
| 683 | |||
| 684 | 11 | public function getNationalPrefix() |
|
| 688 | |||
| 689 | 201 | public function setNationalPrefix($value) |
|
| 694 | |||
| 695 | 1 | public function clearNationalPrefix() |
|
| 696 | 1 | { |
|
| 697 | $this->nationalPrefix = ''; |
||
| 698 | return $this; |
||
| 699 | 511 | } |
|
| 700 | |||
| 701 | 511 | public function hasPreferredExtnPrefix() |
|
| 705 | |||
| 706 | 3147 | public function getPreferredExtnPrefix() |
|
| 710 | |||
| 711 | 772 | public function setPreferredExtnPrefix($value) |
|
| 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() |
|
| 732 | |||
| 733 | 1 | public function setNationalPrefixForParsing($value) |
|
| 738 | |||
| 739 | 1684 | public function hasNationalPrefixTransformRule() |
|
| 743 | |||
| 744 | 5 | public function getNationalPrefixTransformRule() |
|
| 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() |
||
| 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() |
||
| 785 | |||
| 786 | 486 | public function intlNumberFormats() |
|
| 790 | |||
| 791 | 1569 | /** |
|
| 792 | * @return bool |
||
| 793 | 1569 | */ |
|
| 794 | 1569 | public function hasLeadingDigits() |
|
| 798 | |||
| 799 | 1 | public function getLeadingDigits() |
|
| 803 | 487 | ||
| 804 | public function setLeadingDigits($value) |
||
| 805 | 487 | { |
|
| 806 | $this->leadingDigits = $value; |
||
| 807 | return $this; |
||
| 808 | 1569 | } |
|
| 809 | |||
| 810 | 1569 | public function isLeadingZeroPossible() |
|
| 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() |
|
| 831 | 1568 | ||
| 832 | 1079 | public function setMobileNumberPortableRegion($value) |
|
| 837 | 1079 | ||
| 838 | 1079 | public function clearMobileNumberPortableRegion() |
|
| 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'])) { |
||
| 989 | |||
| 990 | public function addNumberFormat(NumberFormat $value) |
||
| 995 | |||
| 996 | public function addIntlNumberFormat(NumberFormat $value) |
||
| 1001 | } |
||
| 1002 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
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.