@@ 433-435 (lines=3) @@ | ||
430 | if ($type['type'] === 'interface') { |
|
431 | return [$type['definition']['name'] => array_values(array_map(function ($type) { |
|
432 | return $type['definition']['name']; |
|
433 | }, array_filter($types, function ($subType) use ($type) { |
|
434 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['interfaces']); |
|
435 | })))]; |
|
436 | } |
|
437 | ||
438 | // Union types combine the two approaches above. |
|
@@ 444-446 (lines=3) @@ | ||
441 | ||
442 | $implicit = array_values(array_map(function ($type) { |
|
443 | return $type['definition']['name']; |
|
444 | }, array_filter($types, function ($subType) use ($type) { |
|
445 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['unions']); |
|
446 | }))); |
|
447 | ||
448 | return [$type['definition']['name'] => array_merge($explicit, $implicit)]; |
|
449 | } |