| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 1467 | public function validate($value, Constraint $constraint) |
|
| 17 | { |
||
| 18 | 1467 | if (empty(trim($value))) { |
|
| 19 | 15 | return; |
|
| 20 | } |
||
| 21 | |||
| 22 | 1452 | $data = json_decode( |
|
| 23 | 1452 | file_get_contents(__DIR__.'/../data/blns.json'), |
|
| 24 | 484 | true |
|
| 25 | 968 | ); |
|
| 26 | |||
| 27 | 1452 | if (in_array($value, $data, true)) { |
|
| 28 | 1449 | $this->context->addViolation($constraint->message); |
|
| 29 | 966 | } |
|
| 30 | 1452 | } |
|
| 31 | } |
||
| 32 |