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

DirectiveType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 27
ccs 10
cts 12
cp 0.8333
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 4 1
A getName() 0 4 1
A build() 0 10 1
1
<?php
2
/**
3
 * Date: 16.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 DirectiveType extends AbstractObjectType
16
{
17
18
    public function resolve($value = null, $args = [])
19
    {
20
        return null; //todo: not supported yet
21
    }
22
23
    /**
24
     * @return String type name
25
     */
26 5
    public function getName()
27
    {
28 5
        return '__Directive';
29
    }
30
31 3
    protected function build(TypeConfigInterface $config)
32
    {
33
        $config
34 3
            ->addField('name', TypeMap::TYPE_STRING)
35 3
            ->addField('description', TypeMap::TYPE_STRING)
36 3
            ->addField('args', new InputValueListType())
37 3
            ->addField('onOperation', TypeMap::TYPE_BOOLEAN)
38 3
            ->addField('onFragment', TypeMap::TYPE_BOOLEAN)
39 3
            ->addField('onField', TypeMap::TYPE_BOOLEAN);
40
    }
41
}