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

Completed
Push — master ( 6f78dc...d7c2e2 )
by Jérémiah
21s queued 11s
created

InvalidArgumentsError::toState()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 15
ccs 10
cts 10
cp 1
rs 9.9666
c 0
b 0
f 0
cc 3
nc 3
nop 0
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Error;
6
7
use Exception;
8
use GraphQL\Error\UserError as GraphQLUserError;
9
10
class InvalidArgumentsError extends GraphQLUserError
11
{
12
    /** @var InvalidArgumentError[] */
13
    private array $errors;
14
15 3
    public function __construct(
16
        array $errors,
17
        string $message = '',
18
        int $code = 0,
19
        Exception $previous = null
20
    ) {
21 3
        $this->errors = $errors;
22 3
        parent::__construct($message, $code, $previous);
23 3
    }
24
25
    /**
26
     * @return InvalidArgumentError[]
27
     */
28 3
    public function getErrors(): array
29
    {
30 3
        return $this->errors;
31
    }
32
33
    /**
34
     * Return a serializable array of validation errors for each argument.
35
     */
36 3
    public function toState(): array
37
    {
38 3
        $state = [];
39 3
        foreach ($this->getErrors() as $error) {
40 3
            $state[$error->getName()] = [];
41 3
            foreach ($error->getErrors() as $violation) {
42 3
                $state[$error->getName()][] = [
43 3
                    'path' => $violation->getPropertyPath(),
44 3
                    'message' => $violation->getMessage(),
45 3
                    'code' => $violation->getCode(),
46
                ];
47
            }
48
        }
49
50 3
        return $state;
51
    }
52
}
53