Completed
Push — master ( 3a14e9...fe7442 )
by Portey
04:17
created

EnumValueType::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
/**
3
 * Date: 03.12.15
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Introspection;
9
10
11
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
12
use Youshido\GraphQL\Type\Object\AbstractObjectType;
13
use Youshido\GraphQL\Type\TypeMap;
14
15
class EnumValueType extends AbstractObjectType
16
{
17
18 3
    protected function build(TypeConfigInterface $config)
19
    {
20
        $config
21 3
            ->addField('name', TypeMap::TYPE_STRING, [
22
                'resolve' => function ($value, $args) {
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $args is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
23
                    $a = 'asd';
0 ignored issues
show
Unused Code introduced by
$a is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
24
                }
25 3
            ])
26 3
            ->addField('description', TypeMap::TYPE_STRING)
27 3
            ->addField('deprecationReason', TypeMap::TYPE_STRING)
28 3
            ->addField('isDeprecated', TypeMap::TYPE_BOOLEAN);
29 3
    }
30
31
    public function resolve($value = null, $args = [])
32
    {
33
        return null;
34
    }
35
36
    /**
37
     * @return String type name
38
     */
39 6
    public function getName()
40
    {
41 6
        return '__EnumValue';
42
    }
43
}