Conditions | 5 |
Paths | 9 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | public static function generate(array $typeFields): array |
||
18 | { |
||
19 | $arguments = []; |
||
20 | |||
21 | foreach ($typeFields as $fieldName => $field) { |
||
22 | $config = $field->config; |
||
23 | |||
24 | $required = isset($config['generator-required']) ? ($config['generator-required'] ? '!' : '') : ''; |
||
25 | $className = get_class($field); |
||
26 | if ($className !== ObjectType::class) { |
||
27 | continue; |
||
28 | } |
||
29 | |||
30 | $arguments[] = sprintf('%s_id: ID%s', $fieldName, $required); |
||
31 | } |
||
32 | |||
33 | return $arguments; |
||
34 | } |
||
36 |