Automattic\WooCommerce\Vendor\GraphQL\Type\Definition

Argument::listFromConfigpublic staticWC 1.0

Method of the class: Argument{}

No Hooks.

Returns

Array. self>

Usage

$result = Argument::listFromConfig( $config ): array;
$config(iterable) (required)
.

Argument::listFromConfig() code WC 10.9.1

public static function listFromConfig(iterable $config): array
{
    $list = [];

    foreach ($config as $name => $argConfig) {
        if (! is_array($argConfig)) {
            $argConfig = ['type' => $argConfig];
        }

        /** @phpstan-var ArgumentConfig $argConfigWithName */
        $argConfigWithName = $argConfig + ['name' => $name];

        $list[] = new self($argConfigWithName);
    }

    return $list;
}