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 (#137)
by Jérémiah
08:18
created

MutationFieldResolver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 16.66%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 32
ccs 2
cts 12
cp 0.1666
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 11 1
A getAliases() 0 4 1
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\GraphQL\Relay\Mutation;
13
14
use GraphQL\Executor\Promise\PromiseAdapter;
15
use Overblog\GraphQLBundle\Definition\Argument;
16
use Overblog\GraphQLBundle\Definition\Resolver\AliasedInterface;
17
use Overblog\GraphQLBundle\Definition\Resolver\ResolverInterface;
18
use Overblog\GraphQLBundle\Resolver\Resolver;
19
20
final class MutationFieldResolver implements ResolverInterface, AliasedInterface
21
{
22
    /**
23
     * @var PromiseAdapter
24
     */
25
    private $promiseAdapter;
26
27
    public function __construct(PromiseAdapter $promiseAdapter)
28
    {
29
        $this->promiseAdapter = $promiseAdapter;
30
    }
31
32
    public function __invoke($args, $context, $info, \Closure $mutateAndGetPayloadCallback)
33
    {
34
        $input = new Argument($args['input']);
35
36
        return $this->promiseAdapter->createFulfilled($mutateAndGetPayloadCallback($input, $context, $info))
37
            ->then(function ($payload) use ($input) {
38
                Resolver::setObjectOrArrayValue($payload, 'clientMutationId', $input['clientMutationId']);
39
40
                return $payload;
41
            });
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 71
    public static function getAliases()
48
    {
49 71
        return ['__invoke' => 'relay_mutation_field'];
50
    }
51
}
52