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
3333 protected static function parseConfig (Node $ node ): array
3434 {
3535 $ 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 );
4437
4538 return $ config ;
4639 }
@@ -54,4 +47,21 @@ protected static function parseFields(Node $node): array
5447 'fields ' => FieldsNode::toConfig ($ node ),
5548 ];
5649 }
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+ }
5767}
You can’t perform that action at this time.
0 commit comments