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 (#40)
by Jérémiah
05:07
created

InputDefinition::toMappingDefinition()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 22
Code Lines 12

Duplication

Lines 22
Ratio 100 %

Code Coverage

Tests 13
CRAP Score 3

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 22
loc 22
ccs 13
cts 13
cp 1
rs 9.2
cc 3
eloc 12
nc 4
nop 1
crap 3
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 Overblog\GraphQLBundle\Definition\Builder\MappingInterface;
15
16 View Code Duplication
class InputDefinition implements MappingInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18 2
    public function toMappingDefinition(array $config)
19
    {
20 2
        $name = $config['name'];
21 2
        $name = preg_replace('/(.*)?Input$/', '$1', $name).'Input';
22
23 2
        $inputFields = empty($config['fields']) || !is_array($config['fields']) ? [] : $config['fields'];
24
25
        return [
26
            $name => [
27 2
                'type' => 'input-object',
28
                'config' => [
29 2
                    'name' => $name,
30 2
                    'fields' => array_merge(
31 2
                        $inputFields,
32
                        [
33 2
                            'clientMutationId' => ['type' => 'String!'],
34
                        ]
35 2
                    ),
36 2
                ],
37 2
            ],
38 2
        ];
39
    }
40
}
41