Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
14 | 1 | public static function create(ConstraintViolationInterface $violation, string $title = 'Validation failed'): self |
|
15 | { |
||
16 | 1 | $model = new self($title, 400); |
|
17 | 1 | $model->setSource([ |
|
18 | 1 | 'parameter' => $violation->getPropertyPath(), |
|
19 | 1 | 'message' => $violation->getMessage(), |
|
20 | ]); |
||
21 | |||
22 | 1 | return $model; |
|
23 | } |
||
24 | } |
||
25 |