PHPackages                             slam/php-validatore-fattura-elettronica - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. slam/php-validatore-fattura-elettronica

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

slam/php-validatore-fattura-elettronica
=======================================

Validatore fattura elettronica

v1.2.1-patch20251024.1(6mo ago)2163.2k↓16.1%5[1 PRs](https://github.com/Slamdunk/php-validatore-fattura-elettronica/pulls)3MITPHPPHP ~8.4.0 || ~8.5.0CI passing

Since Nov 8Pushed 2mo ago6 watchersCompare

[ Source](https://github.com/Slamdunk/php-validatore-fattura-elettronica)[ Packagist](https://packagist.org/packages/slam/php-validatore-fattura-elettronica)[ Fund](https://paypal.me/filippotessarotto)[ GitHub Sponsors](https://github.com/Slamdunk)[ RSS](/packages/slam-php-validatore-fattura-elettronica/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (5)Versions (18)Used By (3)

Validatore di XML della Fattura Elettronica
===========================================

[](#validatore-di-xml-della-fattura-elettronica)

[![Latest Stable Version](https://camo.githubusercontent.com/232e8b02d92a22721e76a1cefd19bce5e203cb342e149ef9f2e8fcbcd6e3f8af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c616d2f7068702d76616c696461746f72652d666174747572612d656c657474726f6e6963612e737667)](https://packagist.org/packages/slam/php-validatore-fattura-elettronica)[![Downloads](https://camo.githubusercontent.com/7908baf1b210808b380e91704e2fc7d1c944e5f3a601d35059006da1556d03b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736c616d2f7068702d76616c696461746f72652d666174747572612d656c657474726f6e6963612e737667)](https://packagist.org/packages/slam/php-validatore-fattura-elettronica)[![Integrate](https://github.com/Slamdunk/php-validatore-fattura-elettronica/workflows/Integrate/badge.svg?branch=master)](https://github.com/Slamdunk/php-validatore-fattura-elettronica/actions)[![Code Coverage](https://camo.githubusercontent.com/72a43cd90e78698134144b0b842755faa2cc3cdb74923d0b964a6fffd7723a14/68747470733a2f2f636f6465636f762e696f2f67682f536c616d64756e6b2f7068702d76616c696461746f72652d666174747572612d656c657474726f6e6963612f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/gh/Slamdunk/php-validatore-fattura-elettronica?branch=master)

**WARNING**: This package only works for *ITALIAN* standards!

Installazione
-------------

[](#installazione)

```
composer require slam/php-validatore-fattura-elettronica

```

Utilizzo
--------

[](#utilizzo)

```
use SlamFatturaElettronica\Validator;

$feValidator = new Validator();
$feValidator->assertValidXml('');

// In caso di struttura XML errata, viene lanciata una
//      SlamFatturaElettronica\Exception\InvalidXmlStructureException
// In caso di XML valido ma non aderente all'XSD, viene lanciata una
//      SlamFatturaElettronica\Exception\InvalidXsdStructureComplianceException
```

Elencare tutte le eccezioni
---------------------------

[](#elencare-tutte-le-eccezioni)

```
use SlamFatturaElettronica\Validator;

$feValidator = new Validator();
$feValidator->getAllExceptions('');

// Restituisce un array contentente le eccezioni rilevati. Se non ci sono errori l'array sarà vuoto:
```

### Notifiche

[](#notifiche)

```
use SlamFatturaElettronica\Validator;

$feValidator = new Validator();
$feValidator->assertValidXml('', Validator::XSD_MESSAGGI_LATEST);
```

Riferimenti
-----------

[](#riferimenti)

I due siti di riferimento sono al momento:

1.
2.

Gli XSD usati da questa libreria sono quelli presi dal primo dei due siti, ovvero `www.agenziaentrate.gov.it`, che a dispetto del numero di versione esplicitato sembra quello più aggiornato (vedi ad esempio tra i tipi di documento la differenza su `Autofattura`).

Validazione Email in versione `1.2.1`
-------------------------------------

[](#validazione-email-in-versione-121)

La versione `1.2.1` introduce una regex per la validazione delle email, che tuttavia è [costruita male](https://github.com/Slamdunk/php-validatore-fattura-elettronica/issues/11#issuecomment-706079124). Visto che la finalità di questa libreria è di più ampio respiro, è stata sovrascritta la regex delle email con una più permissiva. La validazione della mail è in capo all'utente:

```
diff --git a/xsd/Schema_VFPR121a.xsd b/xsd/Schema_VFPR121a.xsd
index e999199..fa5696b 100644
--- a/xsd/Schema_VFPR121a.xsd
+++ b/xsd/Schema_VFPR121a.xsd
@@ -1364,8 +1364,9 @@

+

-
+

```

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance78

Regular maintenance activity

Popularity39

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 77% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~195 days

Recently: every ~243 days

Total

14

Last Release

207d ago

PHP version history (7 changes)v1.2-patch20181010.1PHP ^7.1

v1.2-patch20181010.3PHP &gt;=5.3.3

v1.2.1-patch20220405.1PHP &gt;=7.2.0

v1.2.1-patch20230222.1PHP ~8.1.0 || ~8.2.0

v1.2.1-patch20231120.1PHP ~8.2.0 || ~8.3.0

v1.2.1-patch20240925.1PHP ~8.3.0 || ~8.4.0

v1.2.1-patch20251024.1PHP ~8.4.0 || ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50348?v=4)[Sahn Lam](/maintainers/Slam)[@slam](https://github.com/slam)

---

Top Contributors

[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (188 commits)")[![Slamdunk](https://avatars.githubusercontent.com/u/152236?v=4)](https://github.com/Slamdunk "Slamdunk (35 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![aded](https://avatars.githubusercontent.com/u/1228793?v=4)](https://github.com/aded "aded (1 commits)")[![ToX82](https://avatars.githubusercontent.com/u/659492?v=4)](https://github.com/ToX82 "ToX82 (1 commits)")

---

Tags

fattura-elettronicafatturazione-elettronicaphpvalidator

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/slam-php-validatore-fattura-elettronica/health.svg)

```
[![Health](https://phpackages.com/badges/slam-php-validatore-fattura-elettronica/health.svg)](https://phpackages.com/packages/slam-php-validatore-fattura-elettronica)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
