public static function getNameMap(): array
    {
        if (self::$nameMap === null) {
            self::$nameMap = [];
            $countries     = self::getLoader()->all();

            foreach ($countries as $country) {
                self::$nameMap[$country['alpha2']] = $country['name'];
            }

            self::$alpha2CodeMap = array_flip(self::$nameMap);
        }

        return self::$nameMap;
    }
public static function getNameMap(): array
    {
        if (self::$nameMap === null) {
            self::$nameMap = [];
            $countries     = self::getLoader()->all();

            foreach ($countries as $country) {
                self::$nameMap[$country['alpha2']] = $country['name'];
            }

            self::$alpha2CodeMap = array_flip(self::$nameMap);
        }

        return self::$nameMap;
    }
public static function getNameMap ( ) : array { if ( self :: $ nameMap === null ) { self :: $ nameMap = [ ] ; $ countries = self :: getLoader ( ) -> all ( ) ; foreach ( $ countries as $ country ) { self :: $ nameMap [ $ country [ 'alpha2' ] ] = $ country [ 'name' ] ; } self :: $ alpha2CodeMap = array_flip ( self :: $ nameMap ) ; } return self :: $ nameMap ; }
Returns an array the country short names indexed by
their respective ISO 3166-1 alpha-2 country code.

@return string[]
Returns an array the country short names indexed by their respective ISO 3166 - 1 alpha - 2 country code .