1 | <?php |
||
27 | class DefinitionBuilder extends BaseBuilder |
||
28 | { |
||
29 | /** |
||
30 | * @var string[] |
||
31 | */ |
||
32 | private const TYPE_DEFINITIONS = [ |
||
33 | 'ObjectDefinition' => Type::OBJECT, |
||
34 | 'SchemaDefinition' => Type::SCHEMA, |
||
35 | 'DirectiveDefinition' => Type::DIRECTIVE, |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * @param RuleInterface $rule |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function match(RuleInterface $rule): bool |
||
46 | |||
47 | /** |
||
48 | * @param ContextInterface $ctx |
||
49 | * @param RuleInterface $rule |
||
50 | * @return \Generator|RecordInterface|TypeNameInterface|void |
||
51 | */ |
||
52 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
||
66 | |||
67 | /** |
||
68 | * @param RuleInterface $rule |
||
69 | * @return TypeNameInterface |
||
70 | */ |
||
71 | private function createTypeName(RuleInterface $rule): TypeNameInterface |
||
78 | |||
79 | /** |
||
80 | * @param RuleInterface $rule |
||
81 | * @return TypeInterface |
||
82 | */ |
||
83 | private function getType(RuleInterface $rule): TypeInterface |
||
89 | |||
90 | /** |
||
91 | * @param ContextInterface $ctx |
||
92 | * @param RuleInterface $rule |
||
93 | * @return iterable |
||
94 | */ |
||
95 | private function createTypeArguments(ContextInterface $ctx, RuleInterface $rule): iterable |
||
107 | } |
||
108 |