Download the PHP package davidepastore/codice-fiscale without Composer
On this page you can find all versions of the php package davidepastore/codice-fiscale. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidepastore/codice-fiscale
More information about davidepastore/codice-fiscale
Files in davidepastore/codice-fiscale
Package codice-fiscale
Short Description An italian tax code calculator and checker
License GPL-2.0-or-later
Informations about the package codice-fiscale
codice-fiscale
A PHP library to calculate and check the italian tax code (codice fiscale).
Read this in Italian.
Install
You can install the library using composer:
How to use
Calculate a codice fiscale
Use the calculator to calculate the codice fiscale.
You can also add an array for additional configuration for the Calculator
. Available array keys are:
- "omocodiaLevel": specifies the level of omocodia that the
Calculator
should consider.
You can also calculate all codici fiscali that a subject could have (using all 128 available levels).
Check if it is valid
Use the checker to check if the given codice fiscale is ok for the given Subject
and additional configuration. The additional configuration array for the Checker
has the given available keys:
- "codiceFiscaleToCheck": the codice fiscale to check;
- "omocodiaLevel": the omocodia level to use to check.
You can also provide as omocodiaLevel
key, the value of Checker::ALL_OMOCODIA_LEVELS
that will check for all the possibilities for the given Subject
.
In the following example, the Subject
would not be valid for the given codice fiscale, but it will be so, cause the check will iterate over all the possibilities for the different omocodia levels.
Formal validation
Use the Validator to verify if the given codice fiscale is formally valid. The additional configuration array for the Validator
has the given available keys:
- "omocodiaAllowed": whether to allow or not omocodia, defaults to true;
- "century": for people over 100 years old, it is not possibile to derive unambiguously birth year, so you can specify the century (for example '18' for a person birth in 1899). It allows to check birth date existence. Defaults to null (auto calculation of the century).
Inverse calculation
Use the InverseCalculator to extract birth date, gender and the belfiore code from the given codice fiscale. The additional configuration array for the InverseCalculator
has the keys already described for the Validator
.
Test
Issues
If you have issues, just open one here.
All versions of codice-fiscale with dependencies
ext-intl Version *