Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#536)
by
unknown
20:45
created

Formatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
c 2
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A onErrorFormatting() 0 18 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Validator;
6
7
use Overblog\GraphQLBundle\Event\ErrorFormattingEvent;
8
use Overblog\GraphQLBundle\Validator\Exception\ArgumentsValidationException;
9
10
class Formatter
11
{
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
        }
31
    }
32
}
33