Automattic\WooCommerce\Vendor\GraphQL\Utils

ASTDefinitionBuilder::makeImplementedInterfacesprivateWC 1.0

Method of the class: ASTDefinitionBuilder{}

No Hooks.

Returns

Array. InterfaceType>

Usage

// private - for code of main (parent) class only
$result = $this->makeImplementedInterfaces( $nodes ): array;
$nodes(array<ObjectTypeDefinitionNode|ObjectTypeExtensionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode>) (required)
.

ASTDefinitionBuilder::makeImplementedInterfaces() code WC 10.9.1

private function makeImplementedInterfaces(array $nodes): array
{
    // Note: While this could make early assertions to get the correctly
    // typed values, that would throw immediately while type system
    // validation with validateSchema() will produce more actionable results.

    $interfaces = [];
    foreach ($nodes as $node) {
        foreach ($node->interfaces as $interface) {
            $interfaces[] = $this->buildType($interface);
        }
    }

    // @phpstan-ignore-next-line generic type will be validated during schema validation
    return $interfaces;
}