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
19:59
created

Formatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
c 2
b 0
f 0
dl 0
loc 20
ccs 13
cts 13
cp 1
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\Exception\ArgumentsValidationException;
9
10
class Formatter
11
{
12 26
    public function onErrorFormatting(ErrorFormattingEvent $event): void
13
    {
14 26
        $error = $event->getError()->getPrevious();
15
16 26
        if ($error instanceof ArgumentsValidationException) {
17 4
            $state = [];
18 4
            $code = [];
19
20 4
            $violations = $error->getViolations();
21 4
            foreach ($violations as $violation) {
22 4
                $state[$violation->getPropertyPath()][] = $violation->getMessage();
23 4
                $code[$violation->getPropertyPath()][] = $violation->getCode();
24
            }
25
26 4
            $formattedError = $event->getFormattedError();
27 4
            $formattedError->offsetSet('state', $state);
28 4
            $formattedError->offsetSet('code', $code);
29 4
            $formattedError->offsetUnset('locations');
30
        }
31 26
    }
32
}
33