| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 20 | public static function validate($phoneNumber, $country) |
||
| 21 | { |
||
| 22 | $phoneNumber = trim($phoneNumber); |
||
| 23 | if (empty($phoneNumber)) { |
||
| 24 | return false; |
||
| 25 | } |
||
| 26 | $country = strtoupper($country); |
||
| 27 | $phoneUtil = PhoneNumberUtil::getInstance(); |
||
| 28 | $numberProto = $phoneUtil->parse($phoneNumber, $country); |
||
| 29 | |||
| 30 | return $phoneUtil->isValidNumber($numberProto); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |