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
Pull Request — master (#7)
by Jérémiah
09:02
created

TypeConfigSolution   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
c 2
b 0
f 0
lcom 1
cbo 2
dl 0
loc 41
ccs 18
cts 18
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A solveTypeCallback() 0 6 1
A solveType() 0 12 3
A solveTypes() 0 10 2
A solveInterfaces() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Resolver\Config;
13
14
class TypeConfigSolution extends AbstractConfigSolution
15
{
16
    const TYPE_CLASS = 'GraphQL\\Type\\Definition\\Type';
17
    const INTERFACE_CLASS = 'GraphQL\\Type\\Definition\\InterfaceType';
18
19
    public function solveTypeCallback($values)
20
    {
21 26
        return function () use ($values) {
22 26
            return $this->solveType($values);
23 26
        };
24
    }
25
26 27
    public function solveType($expr, $parentClass = self::TYPE_CLASS)
27
    {
28 27
        $type = $this->typeResolver->resolve($expr);
29
30 27
        if (null !== $parentClass && !$type instanceof $parentClass) {
31 1
            throw new \InvalidArgumentException(
32 1
                sprintf('Invalid type! Must be instance of "%s"', $parentClass)
33 1
            );
34
        }
35
36 26
        return $type;
37
    }
38
39 11
    public function solveTypes(array $rawTypes, $parentClass = self::TYPE_CLASS)
40
    {
41 11
        $types = [];
42
43 11
        foreach ($rawTypes as $alias) {
44 11
            $types[] = $this->solveType($alias, $parentClass);
45 11
        }
46
47 11
        return $types;
48
    }
49
50 11
    public function solveInterfaces(array $rawInterfaces)
51
    {
52 11
        return $this->solveTypes($rawInterfaces, self::INTERFACE_CLASS);
53
    }
54
}
55