Completed
Push — master ( 0f7b0a...750008 )
by Christoffer
02:09
created

ValidationProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 6 1
1
<?php
2
3
namespace Digia\GraphQL\Provider;
4
5
use Digia\GraphQL\Validation\ContextBuilder;
6
use Digia\GraphQL\Validation\ContextBuilderInterface;
7
use Digia\GraphQL\Validation\Validator;
8
use Digia\GraphQL\Validation\ValidatorInterface;
9
use League\Container\ServiceProvider\AbstractServiceProvider;
10
11
class ValidationProvider extends AbstractServiceProvider
12
{
13
    /**
14
     * @var array
15
     */
16
    protected $provides = [
17
        ContextBuilderInterface::class,
18
        ValidatorInterface::class,
19
    ];
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function register()
25
    {
26
        $this->container->add(ContextBuilderInterface::class, ContextBuilder::class, true/* $shared */);
27
28
        $this->container->add(ValidatorInterface::class, Validator::class, true/* $shared */)
29
            ->withArgument(ContextBuilderInterface::class);
30
    }
31
}
32