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 ( 73cd7f...5ec16c )
by Jérémiah
14s queued 10s
created

ArgumentFactory::wrapResolverArgs()   A

Complexity

Conditions 3
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 1
nop 1
crap 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition;
6
7
class ArgumentFactory
8
{
9
    private $className;
10
11 120
    public function __construct(string $className)
12
    {
13 120
        $this->className = $className;
14 120
    }
15
16
    /**
17
     * @param array|null $rawArguments
18
     *
19
     * @return ArgumentInterface
20
     */
21 65
    public function create(?array $rawArguments): ArgumentInterface
22
    {
23 65
        $className = $this->className;
24
        /** @var ArgumentInterface $arguments */
25 65
        $arguments = new $className();
26 65
        $arguments->exchangeArray($rawArguments);
27
28 65
        return $arguments;
29
    }
30
31 89
    public function wrapResolverArgs(callable $resolver): \Closure
32
    {
33
        return function () use ($resolver) {
34 64
            $args = \func_get_args();
35 64
            if (isset($args[1]) && !$args[1] instanceof ArgumentInterface) {
36 63
                $args[1] = $this->create($args[1]);
37
            }
38
39 64
            return $resolver(...$args);
40 89
        };
41
    }
42
}
43