File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
src/Config/Parser/GraphQL/ASTConverter Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,7 @@ public static function toConfig(Node $node): array
33
33
protected static function parseConfig (Node $ node ): array
34
34
{
35
35
$ config = DescriptionNode::toConfig ($ node ) + static ::parseFields ($ node );
36
-
37
- if (!empty ($ node ->interfaces )) {
38
- $ interfaces = [];
39
- foreach ($ node ->interfaces as $ interface ) {
40
- $ interfaces [] = TypeNode::astTypeNodeToString ($ interface );
41
- }
42
- $ config ['interfaces ' ] = $ interfaces ;
43
- }
36
+ $ config += static ::parseInterfaces ($ node );
44
37
45
38
return $ config ;
46
39
}
@@ -54,4 +47,21 @@ protected static function parseFields(Node $node): array
54
47
'fields ' => FieldsNode::toConfig ($ node ),
55
48
];
56
49
}
50
+
51
+ /**
52
+ * @return array<string,array<string>>
53
+ */
54
+ protected static function parseInterfaces (Node $ node ): array
55
+ {
56
+ $ config = [];
57
+ if (isset ($ node ->interfaces ) && !empty ($ node ->interfaces )) {
58
+ $ interfaces = [];
59
+ foreach ($ node ->interfaces as $ interface ) {
60
+ $ interfaces [] = TypeNode::astTypeNodeToString ($ interface );
61
+ }
62
+ $ config ['interfaces ' ] = $ interfaces ;
63
+ }
64
+
65
+ return $ config ;
66
+ }
57
67
}
You can’t perform that action at this time.
0 commit comments