| Conditions | 6 |
| Paths | 5 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 6.105 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 2 | public function validate($value, Constraint $constraint) |
|
| 33 | { |
||
| 34 | 2 | if (!isset($value) || $value === null || !strlen(trim($value))) { |
|
| 35 | 1 | return; |
|
| 36 | } |
||
| 37 | 2 | if (!self::checkLength($value)) { |
|
| 38 | 1 | $this->context->addViolation($constraint->lengthMessage); |
|
| 39 | } |
||
| 40 | 2 | if (!self::isCEPValid($value)) { |
|
| 41 | $this->context->addViolation($constraint->message); |
||
| 42 | } |
||
| 45 |