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

SchemaBuilder   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A create() 0 19 2
1
<?php
2
3
namespace Overblog\GraphQLBundle\Definition\Builder;
4
5
use GraphQL\Type\Schema;
6
use Overblog\GraphQLBundle\Resolver\ResolverInterface;
7
8
class SchemaBuilder
9
{
10
    /** @var ResolverInterface */
11
    private $typeResolver;
12
13
    /** @var bool */
14
    private $enableValidation;
15
16 64
    public function __construct(ResolverInterface $typeResolver, $enableValidation = false)
17
    {
18 64
        $this->typeResolver = $typeResolver;
19 64
        $this->enableValidation = $enableValidation;
20 64
    }
21
22
    /**
23
     * @param null|string $queryAlias
24
     * @param null|string $mutationAlias
25
     * @param null|string $subscriptionAlias
26
     *
27
     * @return Schema
28
     */
29 64
    public function create($queryAlias = null, $mutationAlias = null, $subscriptionAlias = null)
30
    {
31 64
        $query = $this->typeResolver->resolve($queryAlias);
32 63
        $mutation = $this->typeResolver->resolve($mutationAlias);
33 63
        $subscription = $this->typeResolver->resolve($subscriptionAlias);
34
35 63
        $schema = new Schema([
36 63
            'query' => $query,
37 63
            'mutation' => $mutation,
38 63
            'subscription' => $subscription,
39 63
            'typeLoader' => [$this->typeResolver, 'resolve'],
40 63
            'types' => [$this->typeResolver, 'getSolutions'],
41
        ]);
42 63
        if ($this->enableValidation) {
43 61
            $schema->assertValid();
44
        }
45
46 63
        return $schema;
47
    }
48
}
49