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