Completed
Pull Request — master (#19)
by David
03:53
created

AbstractAnnotatedObjectType::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
4
namespace TheCodingMachine\GraphQL\Controllers;
5
6
7
use TheCodingMachine\GraphQL\Controllers\Registry\RegistryInterface;
8
use Youshido\GraphQL\Config\Object\ObjectTypeConfig;
9
use Youshido\GraphQL\Type\Object\AbstractObjectType;
10
11
abstract class AbstractAnnotatedObjectType extends AbstractObjectType
12
{
13
    /**
14
     * @var RegistryInterface
15
     */
16
    private $registry;
17
18
    public function __construct(RegistryInterface $registry)
19
    {
20
        $this->registry = $registry;
21
        parent::__construct([]);
22
    }
23
24
    /**
25
     * @param ObjectTypeConfig $config
26
     */
27
    public function build($config)
28
    {
29
        $fieldProvider = new ControllerQueryProvider($this, $this->registry);
30
        $fields = $fieldProvider->getFields();
31
        $this->addFields($fields);
32
    }
33
}