@@ 311-313 (lines=3) @@ | ||
308 | if ($type['type'] === 'interface') { |
|
309 | return [$type['definition']['name'] => array_values(array_map(function ($type) { |
|
310 | return $type['definition']['name']; |
|
311 | }, array_filter($types, function ($subType) use ($type) { |
|
312 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['interfaces']); |
|
313 | })))]; |
|
314 | } |
|
315 | ||
316 | // Union types combine the two approaches above. |
|
@@ 322-324 (lines=3) @@ | ||
319 | ||
320 | $implicit = array_values(array_map(function ($type) { |
|
321 | return $type['definition']['name']; |
|
322 | }, array_filter($types, function ($subType) use ($type) { |
|
323 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['unions']); |
|
324 | }))); |
|
325 | ||
326 | return [$type['definition']['name'] => array_merge($explicit, $implicit)]; |
|
327 | } |