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::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 4
crap 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\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