| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 2 | public function validate($value, Constraint $constraint) |
|
| 30 | { |
||
| 31 | // Remove formatting |
||
| 32 | 2 | $number = preg_replace('/[^0-9]/', '', $value); |
|
| 33 | |||
| 34 | // Check length |
||
| 35 | 2 | if (strlen($number) > self::MAX_E164_LENGTH |
|
| 36 | 2 | && $constraint instanceof E164PhoneNumber |
|
| 37 | ) { |
||
| 38 | 1 | $this->context->addViolation($constraint->maxMessage); |
|
| 39 | } |
||
| 42 |