@@ 476-478 (lines=3) @@ | ||
473 | if ($type['type'] === 'interface') { |
|
474 | return [$type['definition']['name'] => array_values(array_map(function ($type) { |
|
475 | return $type['definition']['name']; |
|
476 | }, array_filter($types, function ($subType) use ($type) { |
|
477 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['interfaces']); |
|
478 | })))]; |
|
479 | } |
|
480 | ||
481 | // Union types combine the two approaches above. |
|
@@ 487-489 (lines=3) @@ | ||
484 | ||
485 | $implicit = array_values(array_map(function ($type) { |
|
486 | return $type['definition']['name']; |
|
487 | }, array_filter($types, function ($subType) use ($type) { |
|
488 | return $subType['type'] === 'type' && in_array($type['definition']['name'], $subType['definition']['unions']); |
|
489 | }))); |
|
490 | ||
491 | return [$type['definition']['name'] => array_merge($explicit, $implicit)]; |
|
492 | } |