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 (#185)
by Jérémiah
07:57
created

SchemaBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 48
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
B create() 0 24 2
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\Definition\Builder;
13
14
use GraphQL\Type\Schema;
15
use Overblog\GraphQLBundle\Resolver\ResolverInterface;
16
17
class SchemaBuilder
18
{
19
    /**
20
     * @var ResolverInterface
21
     */
22
    private $typeResolver;
23
24
    /** @var bool */
25
    private $enableValidation;
26
27 15
    public function __construct(ResolverInterface $typeResolver, $enableValidation = false)
28
    {
29 15
        $this->typeResolver = $typeResolver;
30 15
        $this->enableValidation = $enableValidation;
31 15
    }
32
33
    /**
34
     * @param null|string $queryAlias
35
     * @param null|string $mutationAlias
36
     * @param null|string $subscriptionAlias
37
     *
38
     * @return Schema
39
     */
40 15
    public function create($queryAlias = null, $mutationAlias = null, $subscriptionAlias = null)
41
    {
42 15
        $query = $this->typeResolver->resolve($queryAlias);
43 15
        $mutation = $this->typeResolver->resolve($mutationAlias);
44 15
        $subscription = $this->typeResolver->resolve($subscriptionAlias);
45
46
        $config = [
47 15
            'query' => $query,
48 15
            'mutation' => $mutation,
49 15
            'subscription' => $subscription,
50 15
        ];
51
52 15
        if ($this->enableValidation) {
53
            // right now config.types is required when using "assertValid"
54 14
            $config['types'] = $this->typeResolver->getSolutions();
55 14
            $schema = new Schema($config);
56 14
            $schema->assertValid();
57 14
        } else {
58 1
            $config['typeLoader'] = [$this->typeResolver, 'resolve'];
59 1
            $schema = new Schema($config);
60
        }
61
62 15
        return $schema;
63
    }
64
}
65