public static function guardAgainstInvalidAlpha3($alpha3)
    {
        if (!is_string($alpha3)) {
            throw new InvalidArgumentException(
                sprintf('Expected $alpha3 to be of type string, got: %s', gettype($alpha3))
            );
        }

        if (!preg_match('/^[a-zA-Z]{3}$/', $alpha3)) {
            throw new DomainException(
                sprintf('Not a valid alpha3 key: %s', $alpha3)
            );
        }
    }
public static function guardAgainstInvalidAlpha3($alpha3)
    {
        if (!is_string($alpha3)) {
            throw new InvalidArgumentException(
                sprintf('Expected $alpha3 to be of type string, got: %s', gettype($alpha3))
            );
        }

        if (!preg_match('/^[a-zA-Z]{3}$/', $alpha3)) {
            throw new DomainException(
                sprintf('Not a valid alpha3 key: %s', $alpha3)
            );
        }
    }
public static function guardAgainstInvalidAlpha3 ( $ alpha3 ) { if ( ! is_string ( $ alpha3 ) ) { throw new InvalidArgumentException ( sprintf ( 'Expected $alpha3 to be of type string, got: %s' , gettype ( $ alpha3 ) ) ) ; } if ( ! preg_match ( '/^[a-zA-Z]{3}$/' , $ alpha3 ) ) { throw new DomainException ( sprintf ( 'Not a valid alpha3 key: %s' , $ alpha3 ) ) ; } }
Assert that input looks like an alpha3 key.

@param string $alpha3

@throws \League\ISO3166\Exception\InvalidArgumentException if input is not a string
@throws \League\ISO3166\Exception\DomainException if input does not look like an alpha3 key
Assert that input looks like an alpha3 key .