Issues (167)

src/Schema/Validation/SchemaValidationProvider.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Digia\GraphQL\Schema\Validation;
4
5
use Digia\GraphQL\Schema\Validation\Rule\DirectivesRule;
6
use Digia\GraphQL\Schema\Validation\Rule\RootTypesRule;
7
use Digia\GraphQL\Schema\Validation\Rule\TypesRule;
8
use League\Container\ServiceProvider\AbstractServiceProvider;
9
10
class SchemaValidationProvider extends AbstractServiceProvider
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $provides = [
16
        SchemaValidatorInterface::class,
17
        RootTypesRule::class,
18
        DirectivesRule::class,
19
        TypesRule::class,
20
    ];
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function register()
26
    {
27
        $this->container->share(SchemaValidatorInterface::class, SchemaValidator::class);
0 ignored issues
show
The method share() does not exist on Psr\Container\ContainerInterface. It seems like you code against a sub-type of Psr\Container\ContainerInterface such as League\Container\Container. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
        $this->container->/** @scrutinizer ignore-call */ 
28
                          share(SchemaValidatorInterface::class, SchemaValidator::class);
Loading history...
28
29
        // Rules
30
        $this->container->add(RootTypesRule::class, RootTypesRule::class);
0 ignored issues
show
The method add() does not exist on Psr\Container\ContainerInterface. It seems like you code against a sub-type of Psr\Container\ContainerInterface such as League\Container\Container. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
        $this->container->/** @scrutinizer ignore-call */ 
31
                          add(RootTypesRule::class, RootTypesRule::class);
Loading history...
31
        $this->container->add(DirectivesRule::class, DirectivesRule::class);
32
        $this->container->add(TypesRule::class, TypesRule::class);
33
    }
34
}
35