godwin/tg-phone-operator-checker
Composer 安装命令:
composer require godwin/tg-phone-operator-checker
包简介
Valider et trouver le nom l'opérateur togolais d'un numéro de téléphone
README 文档
README
TG Phone Operator Checker is a PHP package that allows you to validate and identify Togolese phone numbers. It provides functionality to clean phone numbers, check their validity, and determine the mobile operator.
Features
- Clean and standardize Togolese phone numbers
- Validate Togolese phone numbers
- Identify the mobile operator (TOGOCOM or MOOV)
- PHP 8.3 compatible
Installation
You can install this package via Composer. Run the following command in your project directory:
composer require godwin/tg-phone-operator-checker
Usage
Here's a quick example of how to use the TG Phone Operator Checker:
use Godwin\TgPhoneOperatorChecker\PhoneOperatorChecker; // Clean a phone number $cleanNumber = PhoneOperatorChecker::clean('90123456'); echo $cleanNumber; // Outputs: 22890123456 // Check if a number is valid $isValid = PhoneOperatorChecker::isValidTogoNumber('22890123456'); echo $isValid ? 'Valid' : 'Invalid'; // Outputs: Valid // Get the operator for a phone number $operator = PhoneOperatorChecker::getOperatorName('22890123456'); echo $operator; // Outputs: TOGOCOM
Available Methods
clean(string $msisdn): string: Standardizes the MSISDN format for Togo numbers.checkMSISDNLength(string $msisdn): bool: Checks if the MSISDN length is valid.channel(string $msisdn): string: Returns the operator channel (TOGOCOM or MOOV) for a given MSISDN.isValidTogoNumber(string $msisdn): bool: Checks if the given number is a valid Togo number.getOperatorName(string $msisdn): string: Returns the operator name for a given MSISDN.
Development
To set up the project for development:
- Clone the repository
- Run
composer installto install dependencies
Running Tests
To run the test suite:
composer test
To generate a code coverage report:
composer test-coverage
Code Style
This project uses PHP-CS-Fixer for code style. To check your code:
composer cs-check
To automatically fix code style issues:
composer cs-fix
Static Analysis
Rector is used for automated code upgrades and refactoring. To run Rector:
composer rector
To see what changes Rector would make without applying them:
composer rector-dry-run
All Checks
To run all checks (tests, code style, and Rector):
composer check-all
To apply all fixes:
composer fix-all
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
godwin/tg-phone-operator-checker 适用场景与选型建议
godwin/tg-phone-operator-checker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 godwin/tg-phone-operator-checker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 godwin/tg-phone-operator-checker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-17