Passed
Pull Request — master (#159)
by Christoffer
03:39
created

SchemaExtensionProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace Digia\GraphQL\SchemaExtension;
4
5
use Digia\GraphQL\SchemaBuilder\DefinitionBuilderCreatorInterface;
6
use League\Container\ServiceProvider\AbstractServiceProvider;
7
8
class SchemaExtensionProvider extends AbstractServiceProvider
9
{
10
    /**
11
     * @var array
12
     */
13
    protected $provides = [
14
        ExtensionContextCreatorInterface::class,
15
        SchemaExtenderInterface::class,
16
    ];
17
18
    /**
19
     * @inheritdoc
20
     */
21
    public function register()
22
    {
23
        $this->container->add(ExtensionContextCreatorInterface::class, ExtensionContextCreator::class, true)
24
            ->withArgument(DefinitionBuilderCreatorInterface::class);
25
26
        $this->container->add(SchemaExtenderInterface::class, SchemaExtender::class)
27
            ->withArgument(ExtensionContextCreatorInterface::class);
28
    }
29
}
30