public static function fromName(string $countryName): Country
    {
        self::getNameMap();

        if (!isset(self::$alpha2CodeMap[$countryName])) {
            throw InvalidArgumentException::format(
                'Invalid country short name supplied to %s: country \'%s\' is not a valid option',
                __METHOD__, $countryName
            );
        }

        return new self(self::$alpha2CodeMap[$countryName]);
    }
public static function fromName(string $countryName): Country
    {
        self::getNameMap();

        if (!isset(self::$alpha2CodeMap[$countryName])) {
            throw InvalidArgumentException::format(
                'Invalid country short name supplied to %s: country \'%s\' is not a valid option',
                __METHOD__, $countryName
            );
        }

        return new self(self::$alpha2CodeMap[$countryName]);
    }
public static function fromName ( string $ countryName ) : Country { self :: getNameMap ( ) ; if ( ! isset ( self :: $ alpha2CodeMap [ $ countryName ] ) ) { throw InvalidArgumentException :: format ( 'Invalid country short name supplied to %s: country \'%s\' is not a valid option' , __METHOD__ , $ countryName ) ; } return new self ( self :: $ alpha2CodeMap [ $ countryName ] ) ; }
Builds a country enum from the supplied country short name.

@param string $countryName

@return Country
@throws InvalidArgumentException
Builds a country enum from the supplied country short name .