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