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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 70.59%

Importance

Changes 2
Bugs 1 Features 2
Metric Value
wmc 5
c 2
b 1
f 2
lcom 1
cbo 3
dl 0
loc 46
ccs 12
cts 17
cp 0.7059
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A create() 0 11 2
A warmUpTypes() 0 6 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 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