Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class MaxLengthFactory implements TranslatableFactoryInterface |
||
11 | { |
||
12 | use FactoryTrait; |
||
13 | |||
14 | /** |
||
15 | * @inheritdoc |
||
16 | */ |
||
17 | 1 | public function create(SymfonyConstraint $constraint): Constraint |
|
18 | { |
||
19 | /** @var Assert\Length $constraint */ |
||
20 | |||
21 | 1 | return new ParsleyAssert\MaxLength([ |
|
22 | 1 | 'max' => $constraint->max, |
|
23 | 1 | 'message' => $this->transChoice( |
|
24 | 1 | $constraint->maxMessage, |
|
25 | 1 | (int) $constraint->max, |
|
26 | 1 | ['{{ limit }}' => $constraint->max] |
|
27 | ), |
||
28 | ]); |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritdoc |
||
33 | */ |
||
34 | 1 | public function supports(SymfonyConstraint $constraint): bool |
|
37 | } |
||
38 | } |
||
39 |