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 (#4)
by Jérémiah
06:39
created

SchemaBuilder::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.7462

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 3
cts 7
cp 0.4286
rs 9.4285
cc 2
eloc 7
nc 2
nop 3
crap 2.7462
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 array */
26
    private $typesMapping;
27
28
    /** @var bool */
29
    private $enableValidation;
30
31 25
    public function __construct(ResolverInterface $typeResolver, array $typesMapping, $enableValidation = false)
32
    {
33 25
        $this->typeResolver = $typeResolver;
34 25
        $this->typesMapping = $typesMapping;
35 25
        $this->enableValidation = $enableValidation;
36 25
    }
37
38
    /**
39
     * @param null|string $queryAlias
40
     * @param null|string $mutationAlias
41
     * @param null|string $subscriptionAlias
42
     *
43
     * @return Schema
44
     */
45 25
    public function create($queryAlias = null, $mutationAlias = null, $subscriptionAlias = null)
46
    {
47 25
        $this->enableValidation ? Config::enableValidation() : Config::disableValidation();
48 25
        $this->warmUpTypes();
49
50
        $query = $this->typeResolver->resolve($queryAlias);
51
        $mutation = $this->typeResolver->resolve($mutationAlias);
52
        $subscription = $this->typeResolver->resolve($subscriptionAlias);
53
54
        return new Schema($query, $mutation, $subscription);
55
    }
56
57 25
    private function warmUpTypes()
58
    {
59 25
        foreach ($this->typesMapping as $alias => $serviceId) {
60 25
            $this->typeResolver->resolve($alias);
61 25
        }
62
    }
63
}
64