Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 102 | public function validate(string $name): ConstraintViolationListInterface |
|
27 | { |
||
28 | 102 | $validator = Validation::createValidator(); |
|
29 | |||
30 | 102 | return $validator->validate($name, [ |
|
31 | 102 | new NotBlank(), |
|
32 | 102 | new Length([ |
|
33 | 102 | 'min' => $this->minLength, |
|
34 | 102 | 'max' => $this->maxLength, |
|
35 | ]), |
||
36 | 102 | new Regex([ |
|
37 | 102 | 'pattern' => '/^[a-zA-Z_][a-zA-Z0-9_]*$/', |
|
38 | ]), |
||
42 |