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:46
created

Formatter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 13
dl 0
loc 21
ccs 13
cts 13
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A onErrorFormatting() 0 19 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
/**
11
 * @author Timur Murtukov <[email protected]>
12
 */
13
class Formatter
14
{
15 26
    public function onErrorFormatting(ErrorFormattingEvent $event): void
16
    {
17 26
        $error = $event->getError()->getPrevious();
18
19 26
        if($error instanceof ArgumentsValidationException)
20
        {
21 4
            $state = [];
22 4
            $code  = [];
23
24 4
            $violations = $error->getViolations();
25 4
            foreach ($violations as $violation) {
26 4
                $state[$violation->getPropertyPath()][] = $violation->getMessage();
27 4
                $code[$violation->getPropertyPath()][] = $violation->getCode();
28
            }
29
30 4
            $formattedError = $event->getFormattedError();
31 4
            $formattedError->offsetSet('state', $state);
32 4
            $formattedError->offsetSet('code', $code);
33 4
            $formattedError->offsetUnset('locations');
34
        }
35 26
    }
36
37
}
38