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 | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function onErrorFormatting(ErrorFormattingEvent $event): void |
||
| 13 | { |
||
| 14 | $error = $event->getError()->getPrevious(); |
||
| 15 | |||
| 16 | if ($error instanceof ArgumentsValidationException) { |
||
| 17 | $state = []; |
||
| 18 | $code = []; |
||
| 19 | |||
| 20 | $violations = $error->getViolations(); |
||
| 21 | foreach ($violations as $violation) { |
||
| 22 | $state[$violation->getPropertyPath()][] = $violation->getMessage(); |
||
| 23 | $code[$violation->getPropertyPath()][] = $violation->getCode(); |
||
| 24 | } |
||
| 25 | |||
| 26 | $formattedError = $event->getFormattedError(); |
||
| 27 | $formattedError->offsetSet('state', $state); |
||
| 28 | $formattedError->offsetSet('code', $code); |
||
| 29 | $formattedError->offsetUnset('locations'); |
||
| 30 | } |
||
| 33 |