Test Failed
Pull Request — master (#19)
by David
02:44
created

AbstractAnnotatedObjectType   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A build() 0 6 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers;
5
6
7
use TheCodingMachine\GraphQL\Controllers\Registry\RegistryInterface;
8
use Youshido\GraphQL\Type\Object\AbstractObjectType;
9
10
abstract class AbstractAnnotatedObjectType extends AbstractObjectType
11
{
12
    /**
13
     * @var RegistryInterface
14
     */
15
    private $registry;
16
17
    public function __construct(RegistryInterface $registry)
18
    {
19
        $this->registry = $registry;
20
        parent::__construct([]);
21
    }
22
23
    /**
24
     * @param ObjectTypeConfig $config
25
     */
26
    public function build($config)
27
    {
28
        $fieldProvider = new ControllerQueryProvider($this, $this->registry);
29
        $fields = $fieldProvider->getFields();
30
        $this->addFields($fields);
31
    }
32
}