Completed
Push — master ( 020154...e8c337 )
by Alexandr
02:45
created

InterfaceType::getPossibleTypes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

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 3
cp 0
rs 10
cc 1
eloc 1
nc 1
nop 0
crap 2
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 12/5/15 12:12 AM
7
*/
8
9
namespace Youshido\GraphQL\Type\Object;
10
11
12
use Youshido\GraphQL\Type\AbstractType;
13
use Youshido\GraphQL\Type\Config\Object\InterfaceTypeConfig;
14
use Youshido\GraphQL\Type\TypeMap;
15
16
class InterfaceType extends AbstractType
17
{
18
19
20
    /**
21
     * ObjectType constructor.
22
     * @param $config
23
     */
24
    public function __construct($config = [])
25
    {
26
        if (empty($config)) {
27
            $config['name'] = $this->getName();
28
        }
29
30
        $this->config = new InterfaceTypeConfig($config, $this);
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Youshido\GraphQL\Ty...eConfig($config, $this) of type object<Youshido\GraphQL\...ct\InterfaceTypeConfig> is incompatible with the declared type object<Youshido\GraphQL\...\InputObjectTypeConfig> of property $config.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31
    }
32
33
    public function getPossibleTypes()
34
    {
35
36
    }
37
38
    public function isPossibleType()
39
    {
40
41
    }
42
43
    public function getObjectType()
44
    {
45
46
    }
47
48
    public function getName()
49
    {
50
        return $this->getConfig()->get('name', 'InterfaceType');
51
    }
52
53
    public function getKind()
54
    {
55
        return TypeMap::KIND_INTERFACE;
56
    }
57
58
    public function isValidValue($value)
59
    {
60
        return true;
61
    }
62
63
}