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

AbstractAnnotatedObjectType::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
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\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
}