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

MutationField   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 2 Features 2
Metric Value
wmc 2
c 3
b 2
f 2
lcom 0
cbo 4
dl 0
loc 39
ccs 0
cts 29
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B toFieldDefinition() 0 34 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\Relay\Mutation;
13
14
use GraphQL\Type\Definition\Config;
15
use GraphQL\Type\Definition\Type;
16
use GraphQL\Utils;
17
use Overblog\GraphQLBundle\Definition\FieldInterface;
18
use Overblog\GraphQLBundle\Definition\MergeFieldTrait;
19
20
class MutationField implements FieldInterface
21
{
22
    use MergeFieldTrait;
23
24
    public function toFieldDefinition(array $config)
25
    {
26
        Utils::invariant(!empty($config['name']), 'Every type is expected to have name');
27
28
        Config::validate($config, [
29
            'name' => Config::STRING | Config::REQUIRED,
30
            'mutateAndGetPayload' => Config::CALLBACK | Config::REQUIRED,
31
            'payloadType' => Config::OBJECT_TYPE | Config::CALLBACK | Config::REQUIRED,
32
            'inputType' => Config::INPUT_TYPE | Config::CALLBACK | Config::REQUIRED,
33
            'description' => Config::STRING,
34
        ]);
35
36
        $name = $config['name'];
37
38
        $mutateAndGetPayload = $config['mutateAndGetPayload'];
39
        $description = isset($config['description']) ? $config['description'] : null;
40
        $payloadType = $config['payloadType'];
41
        $inputType = $config['inputType'];
42
43
        return [
44
            'name' => $name,
45
            'description' => $description,
46
            'type' => $payloadType,
47
            'args' => [
48
                'input' => ['type' => Type::nonNull($inputType)],
49
            ],
50
            'resolve' => function ($_, $input, $info) use ($mutateAndGetPayload, $name) {
51
                $payload = $mutateAndGetPayload($input['input'], $info);
52
                $payload['clientMutationId'] = $input['input']['clientMutationId'];
53
54
                return $payload;
55
            },
56
        ];
57
    }
58
}
59