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 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 26 | public function onErrorFormatting(ErrorFormattingEvent $event): void |
|
| 23 | { |
||
| 24 | 26 | $error = $event->getError()->getPrevious(); |
|
| 25 | |||
| 26 | 26 | if ($error instanceof ArgumentsValidationException) { |
|
| 27 | 4 | $validation = []; |
|
| 28 | |||
| 29 | 4 | foreach ($error->getViolations() as $violation) { |
|
| 30 | 4 | $validation[$violation->getPropertyPath()][] = [ |
|
| 31 | 4 | 'message' => $violation->getMessage(), |
|
| 32 | 4 | 'code' => $violation->getCode(), |
|
| 33 | ]; |
||
| 34 | } |
||
| 35 | |||
| 36 | 4 | $formattedError = $event->getFormattedError(); |
|
| 37 | 4 | $formattedError['extensions']['validation'] = $validation; |
|
| 38 | } |
||
| 41 |