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 (#23)
by Jérémiah
12:19
created

ObjectType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 6
dl 0
loc 41
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 29 5
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\Definition;
13
14
use GraphQL\Type\Definition\Config;
15
use GraphQL\Type\Definition\ObjectType as BaseObjectType;
16
use GraphQL\Utils;
17
18
class ObjectType extends BaseObjectType
19
{
20
    use FieldsTrait;
21
22
    private $_isTypeOf;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
23
24
    /**
25
     * @param array $config
26
     *
27
     * @todo open PR on lib to ease inheritance
28
     */
29
    public function __construct(array $config)
30
    {
31
        Utils::invariant(!empty($config['name']), 'Every type is expected to have name');
32
33
        Config::validate($config, [
34
            'name' => Config::STRING | Config::REQUIRED,
35
            'fields' => Config::arrayOf(
36
                FieldDefinition::getDefinition(),
37
                Config::KEY_AS_NAME | Config::MAYBE_THUNK
38
            ),
39
            'description' => Config::STRING,
40
            'interfaces' => Config::arrayOf(
41
                Config::INTERFACE_TYPE,
42
                Config::MAYBE_THUNK
43
            ),
44
            'isTypeOf' => Config::CALLBACK, // ($value, ResolveInfo $info) => boolean
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
45
            'resolveField' => Config::CALLBACK,
46
        ]);
47
48
        $this->name = $config['name'];
49
        $this->description = isset($config['description']) ? $config['description'] : null;
50
        $this->resolveFieldFn = isset($config['resolveField']) ? $config['resolveField'] : null;
51
        $this->_isTypeOf = isset($config['isTypeOf']) ? $config['isTypeOf'] : null;
52
        $this->config = $config;
53
54
        if (isset($config['interfaces'])) {
55
            InterfaceType::addImplementationToInterfaces($this);
56
        }
57
    }
58
}
59