| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function validate(IValidate $entry): void |
||
| 26 | { |
||
| 27 | $phoneUtil = PhoneNumberUtil::getInstance(); |
||
| 28 | try { |
||
| 29 | $number = $phoneUtil->parse($entry->getValue(), $this->againstValue); |
||
| 30 | if ($phoneUtil->isValidNumber($number)) { |
||
| 31 | return; |
||
| 32 | } |
||
| 33 | throw new RuleException($this->errorText); |
||
| 34 | } catch (NumberParseException $e) { |
||
| 35 | throw new RuleException($this->errorText, 0, $e); |
||
| 36 | } |
||
| 39 |