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