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 (#137)
by Jérémiah
08:18
created

SchemaBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 39
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 15 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\Schema;
15
use GraphQL\Type\Definition\Config;
16
use Overblog\GraphQLBundle\Resolver\ResolverInterface;
17
18
class SchemaBuilder
19
{
20
    /**
21
     * @var ResolverInterface
22
     */
23
    private $typeResolver;
24
25
    /** @var bool */
26
    private $enableValidation;
27
28
    public function __construct(ResolverInterface $typeResolver, $enableValidation = false)
29
    {
30
        $this->typeResolver = $typeResolver;
31
        $this->enableValidation = $enableValidation;
32
    }
33
34
    /**
35
     * @param null|string $queryAlias
36
     * @param null|string $mutationAlias
37
     * @param null|string $subscriptionAlias
38
     *
39
     * @return Schema
40
     */
41
    public function create($queryAlias = null, $mutationAlias = null, $subscriptionAlias = null)
42
    {
43
        $this->enableValidation ? Config::enableValidation() : Config::disableValidation();
44
45
        $query = $this->typeResolver->resolve($queryAlias);
46
        $mutation = $this->typeResolver->resolve($mutationAlias);
47
        $subscription = $this->typeResolver->resolve($subscriptionAlias);
48
49
        return new Schema([
50
            'query' => $query,
51
            'mutation' => $mutation,
52
            'subscription' => $subscription,
53
            'types' => $this->typeResolver->getSolutions(),
54
        ]);
55
    }
56
}
57