tourze / gb-t-4880
GB/T 4880
0.0.1
2025-05-29 10:23 UTC
Requires
- php: ^8.1
- tourze/enum-extra: 0.1.*
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-06-03 06:56:46 UTC
README
GB/T 4880 is a PHP package implementing the GB/T 4880.1-2005 language code standard. It provides an enum class containing all two-letter language codes defined by the standard, along with their Chinese labels.
Features
- Implements the GB/T 4880.1-2005 standard
- Provides all two-letter language codes
- Includes corresponding Chinese labels
- Utilizes PHP 8.1+ enum features
- Implements
Labelable
,Itemable
, andSelectable
interfaces
Requirements
- PHP 8.1 or higher
- tourze/enum-extra
Installation
composer require tourze/gb-t-4880
Quick Start
use Tourze\GBT4880\Alpha2Code; // Get language code $code = Alpha2Code::Chinese->value; // 'zh' // Get Chinese label $name = Alpha2Code::Chinese->getLabel(); // '汉语'
Documentation
- All enum cases are defined by the GB/T 4880.1-2005 standard
- Use
getLabel()
to get the Chinese label - Implements Labelable, Itemable, and Selectable interfaces for easy integration with the tourze/enum-extra ecosystem
Contributing
- Issues and PRs are welcome
- Please follow PSR coding standards
- Ensure all tests pass before submitting
License
MIT
Author
tourze