| @@ -564,9 +564,9 @@ | ||
| 564 | 564 | * @inheritDoc |
| 565 | 565 | */ |
| 566 | 566 | public function serialize() |
| 567 | 567 | { |
| 568 | - return serialize( | |
| 568 | + return __serialize( | |
| 569 | 569 | array( |
| 570 | 570 | $this->countryCode, |
| 571 | 571 | $this->nationalNumber, |
| 572 | 572 | $this->extension, |
| @@ -583,9 +583,9 @@ | ||
| 583 | 583 | * @inheritDoc |
| 584 | 584 | */ |
| 585 | 585 | public function unserialize($serialized) |
| 586 | 586 | { |
| 587 | - $data = unserialize($serialized); | |
| 587 | + $data = __unserialize($serialized); | |
| 588 | 588 | |
| 589 | 589 | list( |
| 590 | 590 | $this->countryCode, |
| 591 | 591 | $this->nationalNumber, |
| @@ -600,5 +600,15 @@ | ||
| 600 | 600 | if ($this->numberOfLeadingZeros > 1) { |
| 601 | 601 | $this->hasNumberOfLeadingZeros = true; |
| 602 | 602 | } |
| 603 | 603 | } |
| 604 | + | |
| 605 | + public function __serialize() { | |
| 606 | + return get_object_vars( $this ); | |
| 607 | + } | |
| 608 | + | |
| 609 | + public function __unserialize( $data ) { | |
| 610 | + foreach ( $data as $key => $value ) { | |
| 611 | + $this->$key = $value; | |
| 612 | + } | |
| 613 | + } | |
| 604 | 614 | } |