Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

declare(strict_types=1);

/*
 * (c) Rob Bast <rob.bast@gmail.com>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace Automattic\WooCommerce\Vendor\League\ISO3166;

use Automattic\WooCommerce\Vendor\League\ISO3166\Exception\DomainException;

final class ISO3166DataValidator
{
    /**
     * @param array<array<string, mixed>> $data
     *
     * @return array<array<string, mixed>>
     */
    public function validate(array $data): array
    {
        foreach ($data as $entry) {
            $this->assertEntryHasRequiredKeys($entry);
        }

        return $data;
    }

    /**
     * @param array<string, mixed> $entry
     *
     * @throws \Automattic\WooCommerce\Vendor\League\ISO3166\Exception\DomainException if given data entry does not have all the required keys
     */
    private function assertEntryHasRequiredKeys(array $entry): void
    {
        if (!isset($entry[ISO3166::KEY_NAME])) {
            throw new DomainException('Each data entry must have a name key.');
        }

        Guards::guardAgainstInvalidName($entry[ISO3166::KEY_NAME]);

        if (!isset($entry[ISO3166::KEY_ALPHA2])) {
            throw n