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::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
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