@@ 300-302 (lines=3) @@ | ||
297 | if ($type['type'] === 'interface') { |
|
298 | return [$type['definition']['name'] => array_values(array_map(function ($type) { |
|
299 | return $type['definition']['name']; |
|
300 | }, array_filter($types, function ($subType) use ($type) { |
|
301 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['interfaces']); |
|
302 | })))]; |
|
303 | } |
|
304 | ||
305 | // Union types combine the two approaches above. |
|
@@ 311-313 (lines=3) @@ | ||
308 | ||
309 | $implicit = 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']['unions']); |
|
313 | }))); |
|
314 | ||
315 | return [$type['definition']['name'] => array_merge($explicit, $implicit)]; |
|
316 | } |