godwin/tg-phone-operator-checker 问题修复 & 功能扩展

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

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

godwin/tg-phone-operator-checker

最新稳定版本:1.0.4

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:

  1. Clone the repository
  2. Run composer install to 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.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固