Automattic\WooCommerce\Vendor\League\ISO3166

Guards::guardAgainstInvalidAlpha3public staticWC 1.0

Assert that input looks like an alpha3 key.

Method of the class: Guards{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Guards::guardAgainstInvalidAlpha3( $alpha3 ): void;
$alpha3(string) (required)
.

Guards::guardAgainstInvalidAlpha3() code WC 10.3.6

public static function guardAgainstInvalidAlpha3(string $alpha3): void
{
    if (1 !== preg_match('/^[a-zA-Z]{3}$/', $alpha3)) {
        throw new DomainException(sprintf('Not a valid alpha3 key: %s', $alpha3));
    }
}