We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function onErrorFormatting(ErrorFormattingEvent $event): void |
||
23 | { |
||
24 | $error = $event->getError()->getPrevious(); |
||
25 | |||
26 | if ($error instanceof ArgumentsValidationException) { |
||
27 | $validation = []; |
||
28 | |||
29 | foreach ($error->getViolations() as $violation) { |
||
30 | $validation[$violation->getPropertyPath()][] = [ |
||
31 | 'message' => $violation->getMessage(), |
||
32 | 'code' => $violation->getCode(), |
||
33 | ]; |
||
34 | } |
||
35 | |||
36 | $formattedError = $event->getFormattedError(); |
||
37 | $formattedError['extensions']['validation'] = $validation; |
||
38 | } |
||
41 |