PHP code example of john-wink / en16931-php
1. Go to this page and download the library: Download john-wink/en16931-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
john-wink / en16931-php example snippets
use JohnWink\En16931\En16931Validator;
// validate() auto-detects CII vs UBL; validateCii()/validateUbl() force one.
$result = En16931Validator::xrechnung()->validate($xml); // or ::en16931()
$result->isValid(); // bool — no fatal violation
foreach ($result->violations as $violation) {
echo "{$violation->ruleId} [{$violation->flag}]: {$violation->message}\n";
}
bash
composer bash
php tools/generate-coverage.php # regenerates COVERAGE.md + this summary