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

InterfaceType   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 48
ccs 0
cts 28
cp 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 2
A getPossibleTypes() 0 4 1
A isPossibleType() 0 4 1
A getObjectType() 0 4 1
A getName() 0 4 1
A getKind() 0 4 1
A isValidValue() 0 4 1
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
}