Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
19 | class Factory implements ValidatorInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string[]|ValidatorInterface[] |
||
23 | */ |
||
24 | private const DEFAULT_VALIDATORS = [ |
||
25 | SchemaValidator::class, |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * @var array|ValidatorInterface[] |
||
30 | */ |
||
31 | private array $validators = []; |
||
32 | |||
33 | /** |
||
34 | * Factory constructor. |
||
35 | */ |
||
36 | public function __construct() |
||
37 | { |
||
38 | foreach (self::DEFAULT_VALIDATORS as $class) { |
||
39 | $this->validators[] = new $class($this); |
||
40 | } |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param DefinitionInterface $type |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function match(DefinitionInterface $type): bool |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param DefinitionInterface $type |
||
54 | * @return void |
||
55 | */ |
||
56 | public function assert(DefinitionInterface $type): void |
||
63 | } |
||
64 | } |
||
67 |