usu/codice-fiscale 问题修复 & 功能扩展

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

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

usu/codice-fiscale

最新稳定版本:v1.0.4

Composer 安装命令:

composer require usu/codice-fiscale

包简介

A library to calculate and check the validity of the italian fiscal code (codice fiscale)

README 文档

README

A library to calculate and check the validity of the italian fiscal code (codice fiscale).

Build Status Latest Stable Version Total Downloads License

Requirements

  • php >= 5.4

Installation

Create a composer.json file with the following content:

{
    "require": {
        "usu/codice-fiscale": "1.0.*"
    }
}

Then run

$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install

You should now have CodiceFiscale installed inside your vendor folder: vendor/usu/codice-fiscale

And an handy autoload file to include in you project: vendor/autoload.php

How to use

<?php
require_once __DIR__ . '/vendor/autoload.php';

use CodiceFiscale\Calculator;
use CodiceFiscale\Checker;

$calc = new Calculator();
$calc->calcola('Nome', 'Cognome', 'M', new \DateTime('1992-03-06'), 'F205');

$chk = new Checker();
if ($chk->isFormallyCorrect('RSSMRA79S18F205J')) {
    print('Codice Fiscale formally correct');
    printf('Birth Day: %s',     $chk->getDayBirth());
    printf('Birth Month: %s',   $chk->getMonthBirth());
    printf('Birth Year: %s',    $chk->getYearBirth());
    printf('Birth Country: %s', $chk->getCountryBirth());
    printf('Sex: %s',           $chk->getSex());
} else {
    print('Codice Fiscale wrong');
}

Testing

The library is fully tested with PHPUnit.

Go to the root folder, install the dev dependencies with composer, and then run the phpunit test suite

$ composer --dev install
$ ./vendor/bin/phpunit

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 2
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-03-11