Total Complexity | 10 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class ValidatorException extends \Symfony\Component\Validator\Exception\ValidatorException |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * @var ConstraintViolationListInterface[] |
||
12 | */ |
||
13 | protected $violations; |
||
14 | |||
15 | public function __construct($violations) |
||
19 | } |
||
20 | |||
21 | protected function buildMessage($violations): string |
||
22 | { |
||
23 | $message = ""; |
||
24 | foreach ($violations as $propertyName => $propertyViolations) { |
||
25 | if (!empty($propertyViolations)) |
||
26 | $message = $message . "Exception on property '" . $propertyName . "': "; |
||
27 | foreach ($propertyViolations as $violation) { |
||
28 | $message = $message . $violation->getMessage() . ""; |
||
29 | } |
||
30 | $message = $message . "\n"; |
||
31 | } |
||
32 | return $message; |
||
33 | } |
||
34 | |||
35 | public function propertyViolationExists(string $property, string $violationClass) |
||
44 | } |
||
45 | |||
46 | public function getViolations(): array |
||
51 | } |