Test Setup Failed
Push — master ( 1595cb...050b68 )
by Kirill
21:00
created

Validator::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of Railt package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Railt\SDL\Validator;
13
14
use GraphQL\Contracts\TypeSystem\DefinitionInterface;
15
16
/**
17
 * Class Validator
18
 */
19
abstract class Validator implements ValidatorInterface
20
{
21
    /**
22
     * @var Factory
23
     */
24
    private Factory $factory;
25
26
    /**
27
     * Validator constructor.
28
     *
29
     * @param Factory $factory
30
     */
31
    public function __construct(Factory $factory)
32
    {
33
        $this->factory = $factory;
34
    }
35
36
    /**
37
     * @param DefinitionInterface $definition
38
     * @return void
39
     */
40
    protected function validate(DefinitionInterface $definition): void
41
    {
42
        $this->factory->assert($definition);
43
    }
44
}
45