Completed
Push — master ( e8c337...7f89eb )
by Alexandr
02:46
created

CharacterInterface::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 12/6/15 11:15 PM
7
*/
8
9
namespace Youshido\Tests\Schema;
10
11
12
use Youshido\GraphQL\Type\Config\Object\InterfaceTypeConfig;
13
use Youshido\GraphQL\Type\Config\TypeConfigInterface;
14
use Youshido\GraphQL\Type\ListType\ListType;
15
use Youshido\GraphQL\Type\Object\InterfaceType;
16
use Youshido\GraphQL\Type\TypeMap;
17
18
class CharacterInterface extends InterfaceType
19
{
20
    protected function build(TypeConfigInterface $config)
21
    {
22
        /** @var InterfaceTypeConfig $config */
23
//        $config->addField('id', TypeMap::TYPE_ID, ['description' => 'ID of the character'])
0 ignored issues
show
Unused Code Comprehensibility introduced by
58% 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...
24
//            ->addField('name', TypeMap::TYPE_STRING, ['description' => 'The name of the character'])
25
//            ;
26
        $config->addFields([
0 ignored issues
show
Bug introduced by
The method addFields() does not exist on Youshido\GraphQL\Type\Config\TypeConfigInterface. Did you maybe mean addField()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
27
                               'id'   => ['type'        => TypeMap::TYPE_ID,
28
                                          'required'    => true,
29
                                          'description' => 'ID of the character'],
30
                               'name' => ['type'        => TypeMap::TYPE_STRING,
31
                                          'description' => 'The name of the character'],
32
                               'friends'   => new ListType(['item' => new CharacterInterface()])
33
                           ]);
34
    }
35
36
    public function getDescription()
37
    {
38
        return 'A character in the Star Wars Trilogy';
39
    }
40
41
    public function getName()
42
    {
43
        return 'Character';
44
    }
45
46
}