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 (#786)
by Timur
23:47
created

GraphQLServices::mutation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Overblog\GraphQLBundle\Definition;
6
7
use GraphQL\Type\Definition\Type;
8
use LogicException;
9
use Overblog\GraphQLBundle\Resolver\MutationResolver;
10
use Overblog\GraphQLBundle\Resolver\QueryResolver;
11
use Overblog\GraphQLBundle\Resolver\TypeResolver;
12
13
/**
14
 * Container for special services to be passed to all generated types.
15
 */
16
final class GraphQLServices
17
{
18
    private array $services;
19
    private TypeResolver $types;
20
    private QueryResolver $queryResolver;
21
    private MutationResolver $mutationResolver;
22
23
    public function __construct(
24
        TypeResolver $typeResolver,
25
        QueryResolver $queryResolver,
26
        MutationResolver $mutationResolver,
27
        array $services = []
28
    ) {
29
        $this->types = $typeResolver;
30
        $this->queryResolver = $queryResolver;
31
        $this->mutationResolver = $mutationResolver;
32
        $this->services = $services;
33
    }
34
35
    /**
36
     * @return mixed
37
     */
38
    public function get(string $name)
39
    {
40
        if (!isset($this->services[$name])) {
41
            throw new LogicException(sprintf('GraphQL service "%s" could not be located. You should define it.', $name));
42
        }
43
44
        return $this->services[$name];
45
    }
46
47
    /**
48
     * Get all GraphQL services.
49
     */
50
    public function getAll(): array
51
    {
52
        return $this->services;
53
    }
54
55
    public function has(string $name): bool
56
    {
57
        return isset($this->services[$name]);
58
    }
59
60
    /**
61
     * @param mixed ...$args
62
     *
63
     * @return mixed
64
     */
65
    public function query(string $alias, ...$args)
66
    {
67
        return $this->queryResolver->resolve([$alias, $args]);
68
    }
69
70
    /**
71
     * @param mixed ...$args
72
     *
73
     * @return mixed
74
     */
75
    public function mutation(string $alias, ...$args)
76
    {
77
        return $this->mutationResolver->resolve([$alias, $args]);
78
    }
79
80
    public function getType(string $typeName): ?Type
81
    {
82
        return $this->types->resolve($typeName);
83
    }
84
}
85