rteeom/isoflags 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rteeom/isoflags

最新稳定版本:v1.3.2

Composer 安装命令:

composer require rteeom/isoflags

包简介

library for easy emoji flags generation from iso country codes

README 文档

README

License Latest Stable Version Total Downloads Tests codecov PHP Version

A modern PHP library for generating emoji flags from ISO 3166-1 alpha-2 country codes and extended regional codes.

Features

  • 🚀 Generate emoji flags from ISO country codes
  • 🌍 Extended regional codes support (Kosovo, Ascension Island, etc.)
  • 🛡️ Type-safe with PHP 8.4 enums
  • ✅ 100% test coverage
  • 📦 Zero dependencies - only requires PHP 8.4+

Installation

composer require rteeom/isoflags

Requirements: PHP 8.4 or higher

Quick Start

use Rteeom\FlagsGenerator\FlagsGenerator;

// Generate emoji flags
echo FlagsGenerator::getFlag('gb'); // 🇬🇧
echo FlagsGenerator::getFlag('ua'); // 🇺🇦
echo FlagsGenerator::getFlag('us'); // 🇺🇸

// Safe usage (returns null for invalid codes)
$flag = FlagsGenerator::getFlagOrNull('invalid'); // null

Extended Regional Codes

use Rteeom\FlagsGenerator\FlagsGenerator;
use Rteeom\FlagsGenerator\Enums\CodeSet;

// Kosovo, Ascension Island, and more
echo FlagsGenerator::getFlag('xk', CodeSet::EXTENDED); // 🇽🇰
echo FlagsGenerator::getFlag('ac', CodeSet::EXTENDED); // 🇦🇨

Validation

use Rteeom\FlagsGenerator\CountryCodeValidator;

$isValid = CountryCodeValidator::isValidCountryCode('gb'); // true
$isValid = CountryCodeValidator::isValidCountryCode('invalid'); // false

Documentation

📚 Read the full documentation →

Development

Run Tests

./vendor/bin/phpunit

Code Quality

make qa  # Run all quality checks

See Contributing Guide for details.

Changelog

See CHANGELOG.md for version history.

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Support

Made with ❤️ by Rteeom

统计信息

  • 总下载量: 463
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-17