承接 patrickjunod/avs-checker 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

patrickjunod/avs-checker

最新稳定版本:2.0.0

Composer 安装命令:

composer require patrickjunod/avs-checker

包简介

AVS Checker - A library for AVS / AHV Number validation

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This small library helps you to validate Swiss Social Security Numbers (AVS / AHV). It will check against regex and checksums to be sure that the number is valid.

Installation

You can install the package via composer:

composer require patrickjunod/avs-checker

Usage

You can use the AVS Checker as a standalone PHP Package:

use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = new AvsChecker('756.3026.0705.92');
$avsNumber->isValid();
// Return true if it's a valid AVS Number, false if not

Facade

Or use it with a facade:

use PatrickJunod\AvsChecker\Facades\AvsChecker;

$avsNumber = AvsChecker::isValid('756.3026.0705.92');
// Return true if it's a valid AVS Number, false if not

Validate without strict mode

You can also validate AVS numbers without dots separation by passing false parameter to the isValid method. This option will validate AVS numbers with AND without dots.

use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid('7563026070592', false);
// Return true

Validate an array of AVS Numbers

You can also validate an array of AVS numbers - with or without strict mode

use PatrickJunod\AvsChecker\AvsChecker;

$avsNumber = AvsChecker::isValid(['7563026070592', '756.2036.0705.92', 'AAA'], false);
// Return an array:
[
  0 => [
    "number" => "7563026070592",
    "isValid" => true
  ],
  1 => [
    "number" => "756.2036.0705.92",
    "isValid" => true
  ],
  2 => [
    "number" => "AAA",
    "isValid" => false
  ]
]

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-21