Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 2 | ||
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))->count()) { |
|
30 | 2 | return $errors; |
|
31 | } |
||
32 | |||
33 | 12 | $_vars = \is_string($string) ? \explode(',', $string) : $string; |
|
34 | |||
35 | 12 | return $validator->validate($_vars, [ |
|
36 | 12 | new Count([ |
|
37 | 12 | 'min' => 1, |
|
38 | 'max' => 3, |
||
39 | ]), |
||
55 |