<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
<?php

declare(strict_types=1);

namespace Automattic\WooCommerce\Api;

/**
 * Resolver container for code-API command classes.
 *
 * Autogenerated GraphQL query and mutation resolvers look up the corresponding
 * code-API command through {@see self::get()}. WooCommerce core delegates every
 * lookup to the main WooCommerce DI container.
 *
 * Sibling plugins that reuse the GraphQL infrastructure and want their command
 * classes instantiated through a container of their own can ship their own
 * Container class at `<plugin-api-namespace>\Container` with the same public
 * signature: ApiBuilder detects it during generation and routes the generated
 * resolvers through it. When no such class is present, resolvers fall back to
 * `new $command_class()`.
 */
final class Container {
	/**
	 * Resolve a command class to an instance.
	 *
	 * @param string $class_name Fully-qualified name of a code-API command class.
	 * @return object An instance of $class_name.
	 */
	public static function get( string $class_name ): object {
		return wc_get_container()->get( $class_name );
	}
}
