true ) ); } return self::$country_map; } /** * Decodes country code to actual country * * @param string $code country code. * @return string|null */ public static function decode( $code ) { $code = strtoupper( $code ); $country_map = self::get_country_map(); return isset( $country_map[ $code ] ) ? $country_map[ $code ] : null; } /** * Get total World Domination >:() * * @param int $count count. * @return float */ public static function get_dom_pct( $count ) { $country_map = self::get_country_map(); $country_count = count( $country_map ); return 0 === $country_count ? 0 : min( round( ( $count / $country_count ) * 100, 2 ), 100 ); } }