Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.3149 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
25 | 14 | public function validate($string): ConstraintViolationListInterface |
|
26 | { |
||
27 | 14 | $validator = Validation::createValidator(); |
|
28 | |||
29 | 14 | if (($errors = $this->notEmpty($string))) { |
|
30 | 14 | return $errors; |
|
31 | } |
||
32 | |||
33 | return $validator->validate(\explode(',', $string), [ |
||
34 | new Count([ |
||
35 | 'min' => 1, |
||
36 | 'max' => 3, |
||
37 | ]), |
||
50 |