diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1d23bf3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Keep tests (including the large generator and validator fixtures) and GitHub +# workflows out of the Packagist/dist archive. +/tests/** export-ignore +/.github/** export-ignore +/phpunit.xml.dist export-ignore diff --git a/.gitignore b/.gitignore index 600e4f1..fe2ef78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ vendor/ -composer.lock .phpunit.cache/ /build/ /tmp/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 7221168..91fd75e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,27 @@ # Changelog -## Unreleased - -- CLI: `vendor/bin/wsystem-einvoice` supports `create`, `--version`, `--help`, `--format`, `--json`, and clear input-error messages (no stack traces). `validate`, `parse` and `rules:update` are wired and will run when the validator module is present. -- Generator: `EInvoice`, `Builder` and `Generator::create()` auto-discover `Validator\Validator` when that class is autoloadable, so a generated PDF is only built when the XML is valid. -- PDF: credit notes show the title, the preceding invoice and no due date; document and line allowances/charges appear on the visual invoice; a default charge reason is no longer printed twice. -- Packagist description and README state that the default install is a core-subset pre-check; official EN 16931 / XRechnung rules need SaxonC or the W System validator/API. -- Generator: UBL 2.1 (EN 16931, XRechnung 3.0, Peppol BIS 3 structure), UN/CEFACT CII D16B (EN 16931, XRechnung 3.0), byte-identical to the W System API (439 parity fixtures + 4,700 fuzzed invoices). -- Generator: ZUGFeRD 2.3 / Factur-X 1.07 (EN 16931 and XRECHNUNG profiles) as PDF/A-3b, built on setasign/fpdf (MIT) with embedded fonts, XMP and sRGB output intent. Visual text uses Windows-1252; other characters are simplified in the visual PDF only, with a note in the result. -- CI: every generated fixture checked with the KoSIT validator, veraPDF and Mustang. -- Package skeleton: namespaces `Generator`, `Validator`, `Model`, `Pdf`; KoSIT XRechnung 3.0.2 rules (2026-08-31) bundled unmodified. +## 0.9.0-beta.1 + +First public beta of `wsystem/einvoice`. + +### Validator + +- Offline `validate()` for UBL, CII and ZUGFeRD / Factur-X / XRechnung PDF/A-3: XML Schema plus EN 16931 and XRechnung 3.0.2 business rules. +- Default engine is `php-core` (`conformance: "pre-check"`, `checked.EN16931: "core-subset"`): a pure-PHP pre-check over the bundled official rule files, not the official engine. +- Optional SaxonC-HE extension (`ext-saxonc`) is auto-detected and reported as `engine: "saxonc"`, `conformance: "official"`. +- Optional `HttpValidator` (`engine: "remote"`) sends the file to the W System validator or API. Opt-in only; the invoice leaves the machine. +- `Parser::parse()` for UBL, CII and hybrid PDFs. `wsystem-einvoice rules:update` checks the published manifest and verifies SHA-256 before unpacking a newer official pack. + +### Generator + +- UBL 2.1 (EN 16931, XRechnung 3.0, Peppol BIS 3 structure) and UN/CEFACT CII D16B, byte-identical to the W System API (439 parity fixtures plus fuzzed invoices). +- ZUGFeRD 2.3 / Factur-X 1.07 (EN 16931 and XRECHNUNG profiles) as PDF/A-3b, built on setasign/fpdf (MIT). Credit notes and allowances/charges are in the XML and on the visual invoice. +- `EInvoice`, `Builder` and `Generator::create()` auto-use the validator when present; a PDF is only built when the XML is valid. Results include `engine` and `conformance`. + +### CLI and packaging + +- `vendor/bin/wsystem-einvoice` supports `create`, `validate`, `parse`, `rules:update`, `--version`, `--help`, `--format` and `--json`. Validate output uses the same engine and conformance labels as the PHP API. +- Composer `suggest` names `ext-saxonc`. `composer.lock` is committed and resolved for PHP 8.1 (PHPUnit 10.5) so the 8.1–8.4 CI matrix can install it. `tests/` (and the large fixtures), `.github/` and `phpunit.xml.dist` are `export-ignore`. +- README and the Packagist description state that the default install is a php-core pre-check; official EN 16931 / XRechnung rules need SaxonC or the W System validator/API. Peppol BIS 3 rules are not included. + +CI checks generated files with the official KoSIT validator, veraPDF (PDF/A-3b) and Mustang. diff --git a/README.md b/README.md index 491b0b8..60df6ac 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ file_put_contents('invoice.xml', $r['xml']); For `zugferd`, `factur-x` and `zugferd-xrechnung`, `$r['pdf']` holds a PDF/A-3b file with the CII XML embedded (`factur-x.xml` / `xrechnung.xml`). Credit notes (`type_code` `381`, plus a preceding invoice) and allowances or charges on the lines or the document are included in both the XML and the visual PDF. +`$r['engine']` is `php-core` (default), `saxonc`, or `remote`. `$r['conformance']` is `pre-check` or `official`. + ## Command line ```bash @@ -44,19 +46,26 @@ vendor/bin/wsystem-einvoice --version vendor/bin/wsystem-einvoice create examples/invoice.json invoice.xml vendor/bin/wsystem-einvoice create --format zugferd examples/invoice.json invoice.pdf vendor/bin/wsystem-einvoice validate invoice.xml +vendor/bin/wsystem-einvoice parse invoice.xml +``` + +On the default install, `validate` prints a line like: + +```text +valid [php-core] EN 16931 + XRechnung 3.0.2: pre-check by the W System pure-PHP engine over the bundled KoSIT/CEN rule files (...), not the official engine ``` -`validate` (and `parse`) are provided by the validator module in this package. They are not in the current pre-release build; `create` works now. Once the module is merged, `validate` runs XML Schema and a pure-PHP pre-check of the core rules by default (see below). +With the SaxonC-HE extension loaded, that becomes `valid [saxonc] … official KoSIT/CEN schematron …`. `--json` prints the same fields as the PHP API (`engine`, `conformance`, `checked`, `errors`). ## Which rules run where -| Mode | XML Schema | EN 16931 rules | XRechnung 3.0.2 rules | -|---|---|---|---| -| Default (pure PHP) | yes | core subset (pre-check) | core subset (pre-check) | -| With the optional SaxonC extension | yes | complete official CEN rule set | complete official KoSIT rule set | -| With the W System validator (self-hosted) or the W System API | yes | complete | complete | +| Engine | How it's enabled | XML Schema | EN 16931 / XRechnung 3.0.2 business rules | Labels in every result | +|---|---|---|---|---| +| `php-core` (default) | nothing to install | yes | pre-check only: a pure-PHP engine runs the bundled official rule files; it is not the official engine | `engine: "php-core"`, `conformance: "pre-check"`, `checked.EN16931: "core-subset"` | +| `saxonc` | optional SaxonC-HE PHP extension (`ext-saxonc`), auto-detected | yes | official KoSIT/CEN schematron (bundled, unmodified) | `engine: "saxonc"`, `conformance: "official"` | +| `remote` | `HttpValidator` (opt-in; the file is sent to the W System validator or API) | yes | official | `engine: "remote"`, `conformance: "official"` | -Out of the box, validation runs XML Schema validation and a pure-PHP pre-check of the core EN 16931 and XRechnung rules. For the complete official rule sets, install the optional SaxonC extension or point the validator at the W System validator or API. Peppol BIS 3 rules are not included. +Out of the box, validation runs XML Schema validation and a pure-PHP pre-check (`php-core`) of the EN 16931 and XRechnung rules. A valid result in this mode is a pre-check, not a conformance check. For the complete official rule sets, install the optional SaxonC-HE extension (`ext-saxonc`) or point the validator at the W System validator or API (`remote`). Peppol BIS 3 rules are not included. Every file the generator produces is tested in CI with the official KoSIT validator, veraPDF (PDF/A-3b) and the Mustang ZUGFeRD validator. diff --git a/composer.json b/composer.json index 97d9972..b67e522 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "phpunit/phpunit": "^10.5 || ^11.0" }, "suggest": { - "ext-saxon": "SaxonC-HE PHP extension: runs the official EN 16931 / XRechnung schematron (XSLT 2.0) in-process, identical to KoSIT", + "ext-saxonc": "SaxonC-HE PHP extension (php -m: saxonc): runs the official EN 16931 / XRechnung schematron (XSLT 2.0) in-process", "wsystem/wsystem-php": "Hosted W System API client: VIES VAT checks, Peppol routing, sending" }, "autoload": { diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..2baab58 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1751 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "b76d6676ff97e7ee85eced0433fed599", + "packages": [ + { + "name": "setasign/fpdf", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/Setasign/FPDF.git", + "reference": "051b70e4c57dedc88df41b1eff1c62894e5f9ed0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Setasign/FPDF/zipball/051b70e4c57dedc88df41b1eff1c62894e5f9ed0", + "reference": "051b70e4c57dedc88df41b1eff1c62894e5f9ed0", + "shasum": "" + }, + "require": { + "ext-gd": "*", + "ext-zlib": "*" + }, + "type": "library", + "autoload": { + "classmap": [ + "fpdf.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Olivier Plathey", + "email": "oliver@fpdf.org", + "homepage": "http://fpdf.org/" + } + ], + "description": "FPDF is a PHP class which allows to generate PDF files with pure PHP. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.", + "homepage": "http://www.fpdf.org", + "keywords": [ + "fpdf", + "pdf" + ], + "support": { + "source": "https://github.com/Setasign/FPDF/tree/1.9.0" + }, + "time": "2026-05-31T14:25:29+00:00", + "published-time": "2026-06-01T08:20:45+00:00" + } + ], + "packages-dev": [ + { + "name": "myclabs/deep-copy", + "version": "1.14.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" + }, + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + } + ], + "time": "2026-08-11T10:17:44+00:00", + "published-time": "2026-08-11T10:29:20+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.9.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9e33da9553fe7786f0962b35f4e4ecf01be89def", + "reference": "9e33da9553fe7786f0962b35f4e4ecf01be89def", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.9.0" + }, + "time": "2026-09-13T18:51:52+00:00", + "published-time": "2026-09-13T18:53:16+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00", + "published-time": "2024-03-03T12:39:44+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00", + "published-time": "2022-02-21T01:04:30+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "10.1.16", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", + "reference": "7e308268858ed6baedc8704a304727d20bc07c77", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=8.1", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-text-template": "^3.0.1", + "sebastian/code-unit-reverse-lookup": "^3.0.0", + "sebastian/complexity": "^3.2.0", + "sebastian/environment": "^6.1.0", + "sebastian/lines-of-code": "^2.0.2", + "sebastian/version": "^4.0.1", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^10.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:31:57+00:00", + "published-time": "2024-08-22T04:32:20+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", + "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T06:24:48+00:00", + "published-time": "2023-08-31T06:25:42+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:56:09+00:00", + "published-time": "2023-02-03T06:56:14+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-08-31T14:07:24+00:00", + "published-time": "2023-08-31T14:08:05+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "6.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:57:52+00:00", + "published-time": "2023-02-03T06:57:58+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "10.5.67", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "1f3e67dd433817bddfc64afab63977cc4b011374" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1f3e67dd433817bddfc64afab63977cc4b011374", + "reference": "1f3e67dd433817bddfc64afab63977cc4b011374", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-filter": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.14.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.1", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-invoker": "^4.0.0", + "phpunit/php-text-template": "^3.0.1", + "phpunit/php-timer": "^6.0.0", + "sebastian/cli-parser": "^2.0.1", + "sebastian/code-unit": "^2.0.0", + "sebastian/comparator": "^5.0.5", + "sebastian/diff": "^5.1.1", + "sebastian/environment": "^6.1.0", + "sebastian/exporter": "^5.1.4", + "sebastian/global-state": "^6.0.2", + "sebastian/object-enumerator": "^5.0.0", + "sebastian/recursion-context": "^5.0.2", + "sebastian/type": "^4.0.0", + "sebastian/version": "^4.0.1" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "10.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.67" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-11-13T11:07:03+00:00", + "published-time": "2026-11-13T11:07:54+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:12:49+00:00", + "published-time": "2024-03-02T07:13:18+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", + "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:58:43+00:00", + "published-time": "2023-02-03T06:58:49+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:59:15+00:00", + "published-time": "2023-02-03T06:59:20+00:00" + }, + { + "name": "sebastian/comparator", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55dfef806eb7dfeb6e7a6935601fef866f8ca48d", + "reference": "55dfef806eb7dfeb6e7a6935601fef866f8ca48d", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/diff": "^5.0", + "sebastian/exporter": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-01-24T09:25:16+00:00", + "published-time": "2026-01-24T09:25:27+00:00" + }, + { + "name": "sebastian/complexity", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "68ff824baeae169ec9f2137158ee529584553799" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", + "reference": "68ff824baeae169ec9f2137158ee529584553799", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:37:17+00:00", + "published-time": "2023-12-21T08:37:41+00:00" + }, + { + "name": "sebastian/diff", + "version": "5.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", + "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0", + "symfony/process": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:15:17+00:00", + "published-time": "2024-03-02T07:15:52+00:00" + }, + { + "name": "sebastian/environment", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", + "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-23T08:47:14+00:00", + "published-time": "2024-03-23T08:48:26+00:00" + }, + { + "name": "sebastian/exporter", + "version": "5.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "0735b90f4da94969541dac1da743446e276defa6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0735b90f4da94969541dac1da743446e276defa6", + "reference": "0735b90f4da94969541dac1da743446e276defa6", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.1", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:09:11+00:00", + "published-time": "2025-09-24T06:10:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T07:19:19+00:00", + "published-time": "2024-03-02T07:19:49+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", + "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-21T08:38:20+00:00", + "published-time": "2023-12-21T08:38:54+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "5.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", + "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "sebastian/object-reflector": "^3.0", + "sebastian/recursion-context": "^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:08:32+00:00", + "published-time": "2023-02-03T07:08:37+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", + "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:06:18+00:00", + "published-time": "2023-02-03T07:06:24+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5d32fe257a9b39cb63146924d6b4e32a22d4502a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5d32fe257a9b39cb63146924d6b4e32a22d4502a", + "reference": "5d32fe257a9b39cb63146924d6b4e32a22d4502a", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2026-08-11T05:27:39+00:00", + "published-time": "2026-08-11T05:28:01+00:00" + }, + { + "name": "sebastian/type", + "version": "4.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", + "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T07:10:45+00:00", + "published-time": "2023-02-03T07:10:50+00:00" + }, + { + "name": "sebastian/version", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-07T11:34:05+00:00", + "published-time": "2023-02-07T11:34:22+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00", + "published-time": "2025-11-17T20:04:52+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=8.1", + "ext-dom": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-zlib": "*" + }, + "platform-dev": {}, + "plugin-api-version": "2.11.0" +} diff --git a/src/Cli.php b/src/Cli.php index e3f6b72..768b214 100644 --- a/src/Cli.php +++ b/src/Cli.php @@ -7,8 +7,7 @@ use WSystem\EInvoice\Generator\Generator; /** - * `vendor/bin/wsystem-einvoice`. create is always available; validate, parse and rules:update run - * when the validator module has shipped the matching class. + * `vendor/bin/wsystem-einvoice`: create, validate, parse and rules:update. */ final class Cli { @@ -39,7 +38,7 @@ public static function run(array $argv, $stdin, $stdout, $stderr): int 'create' => self::create(array_slice($argv, 1), $stdin, $stdout, $stderr), 'validate' => self::validate(array_slice($argv, 1), $stdin, $stdout, $stderr), 'parse' => self::parse(array_slice($argv, 1), $stdin, $stdout, $stderr), - 'rules:update' => self::rulesUpdate($stderr), + 'rules:update' => self::rulesUpdate($stdout, $stderr), default => self::fail($stderr, 'unknown command: ' . $cmd . "\n" . self::usage(), self::EXIT_USAGE), }; } catch (InputError $e) { @@ -70,10 +69,10 @@ public static function usage(): string errors) as JSON on stdout; for PDF formats give an output path, because the PDF is not placed inside the JSON. -validate and parse are provided by the validator module. Out of the box, -validate runs XML Schema and a pure-PHP pre-check of the core EN 16931 and -XRechnung rules (not a conformance check). The complete official rule sets -need the optional SaxonC extension or the W System validator or API. +validate runs XML Schema and, by default, the php-core engine (conformance: +pre-check) — a pre-check, not a conformance check. The complete official rule +sets need the optional SaxonC-HE extension (engine saxonc, ext-saxonc) or the +W System validator or API (engine remote). Exit codes: 0 ok, 1 input or validation error, 2 usage. @@ -179,14 +178,17 @@ private static function parse(array $args, $stdin, $stdout, $stderr): int return self::EXIT_OK; } - /** @param resource $stderr */ - private static function rulesUpdate($stderr): int + /** + * @param resource $stdout + * @param resource $stderr + */ + private static function rulesUpdate($stdout, $stderr): int { $class = 'WSystem\\EInvoice\\Validator\\RuleUpdater'; if (!class_exists($class) || !method_exists($class, 'update')) { return self::fail($stderr, "rules:update is provided by the validator module, which is not in this build yet.\n", self::EXIT_USAGE); } - return (int) $class::update(); + return (int) $class::update(null, null, $stdout); } /** @@ -282,12 +284,9 @@ private static function writeValidation(array $r, bool $asJson, $stdout, $stderr fwrite($stdout, json_encode($r, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . "\n"); } else { $ok = !empty($r['valid']); - $backend = $r['backend'] ?? $r['engine'] ?? 'unknown'; - $checked = $r['checked']['EN16931'] ?? null; - $label = $checked === 'core-subset' || ($r['conformance'] ?? '') === 'pre-check' - ? 'pre-check (core subset, not a conformance check)' - : (string) ($r['rule_set'] ?? $backend); - fwrite($stdout, ($ok ? 'valid' : 'invalid') . " [$backend] $label\n"); + $engine = $r['engine'] ?? $r['backend'] ?? 'unknown'; + $label = (string) ($r['rule_set'] ?? $r['conformance'] ?? $engine); + fwrite($stdout, ($ok ? 'valid' : 'invalid') . " [$engine] $label\n"); if (!empty($r['errors'])) { fwrite($stdout, self::summariseErrors($r) . "\n"); } diff --git a/src/Generator/Generator.php b/src/Generator/Generator.php index 6a71a4f..2582251 100644 --- a/src/Generator/Generator.php +++ b/src/Generator/Generator.php @@ -52,9 +52,11 @@ public static function create(array $invoice, ?ValidatorInterface $validator = n $notes[] = 'Built to the Peppol BIS Billing 3.0 structure and checked against EN 16931 only; Peppol-specific rules are not run.'; } $v = $validator?->validate($b['xml'], $b['xrechnung'] ? 'xrechnung' : 'en16931'); + $engine = $v['engine'] ?? $v['backend'] ?? 'none'; $r = ['valid' => $v['valid'] ?? null, 'format' => $b['format'], 'syntax' => $b['syntax'], 'totals' => $b['totals'], 'xml' => $b['xml'], 'errors' => $v['errors'] ?? [], 'warnings' => $v['warnings'] ?? [], 'checked' => $v['checked'] ?? null, - 'validator' => $v['backend'] ?? 'none', 'notes' => $notes, 'disclaimer' => Codes::DISCLAIMER]; + 'validator' => $engine, 'engine' => $engine, 'conformance' => $v['conformance'] ?? null, + 'notes' => $notes, 'disclaimer' => $v['disclaimer'] ?? Codes::DISCLAIMER]; if ($b['pdf'] !== null) { $r['embedded_file'] = $b['pdf']['file_name']; $r['zugferd_profile'] = $b['pdf']['level'] === 'EN 16931' ? 'EN 16931 (COMFORT)' : 'XRECHNUNG'; diff --git a/src/Version.php b/src/Version.php index 38d3188..5e0f8b3 100644 --- a/src/Version.php +++ b/src/Version.php @@ -4,8 +4,8 @@ namespace WSystem\EInvoice; -/** Package version reported by `wsystem-einvoice --version`. Bump when tagging; the "-dev" suffix is dropped on a release tag. */ +/** Package version reported by `wsystem-einvoice --version`. Bump this in the same commit as a release tag. */ final class Version { - public const VERSION = '0.9.0-dev'; + public const VERSION = '0.9.0-beta.1'; } diff --git a/tests/CliTest.php b/tests/CliTest.php index c733fc2..a35920a 100644 --- a/tests/CliTest.php +++ b/tests/CliTest.php @@ -21,8 +21,10 @@ public function testVersionAndHelp(): void $this->assertSame(0, $code); $this->assertSame('', $err); $this->assertStringContainsString('wsystem-einvoice create', $out); + $this->assertStringContainsString('php-core', $out); $this->assertStringContainsString('pre-check', $out); - $this->assertStringContainsString('SaxonC', $out); + $this->assertStringContainsString('saxonc', $out); + $this->assertStringContainsString('ext-saxonc', $out); } public function testUnknownCommandIsUsage(): void @@ -69,6 +71,11 @@ public function testCreateJsonWritesPdfAndMetadata(): void $meta = json_decode($out, true); $this->assertSame('zugferd', $meta['format']); $this->assertSame('955.00', $meta['totals']['line_total']); + $this->assertContains($meta['engine'], ['php-core', 'saxonc']); + if ($meta['engine'] === 'php-core') { + $this->assertSame('pre-check', $meta['conformance']); + $this->assertTrue($meta['valid']); + } $this->assertArrayNotHasKey('pdf', $meta); $this->assertStringStartsWith('%PDF-1.7', file_get_contents($outFile)); } finally { @@ -115,18 +122,64 @@ public function testCreateTypedInputError(): void $this->assertStringContainsString('input error: issue_date must be YYYY-MM-DD', $err); } - public function testValidateAndParseAnnounceMissingModule(): void + public function testValidateAndParseAGeneratedInvoice(): void { - if (class_exists(\WSystem\EInvoice\Validator\Validator::class)) { - $this->markTestSkipped('validator module is present'); + $in = __DIR__ . '/../examples/invoice.json'; + $xmlFile = sys_get_temp_dir() . '/ws-cli-' . bin2hex(random_bytes(4)) . '.xml'; + try { + [$code, , $err] = self::runCli(['wsystem-einvoice', 'create', $in, $xmlFile]); + $this->assertSame(0, $code, $err); + $xml = file_get_contents($xmlFile); + + [$code, $out, $err] = self::runCli(['wsystem-einvoice', 'validate', '--json', $xmlFile]); + $this->assertSame(0, $code, $err); + $r = json_decode($out, true); + $this->assertIsArray($r); + $this->assertTrue($r['valid']); + $this->assertContains($r['engine'], ['php-core', 'saxonc']); + if ($r['engine'] === 'php-core') { + $this->assertSame('pre-check', $r['conformance']); + $this->assertSame('core-subset', $r['checked']['EN16931']); + } else { + $this->assertSame('official', $r['conformance']); + } + + [$code, $out, $err] = self::runCli(['wsystem-einvoice', 'validate', $xmlFile]); + $this->assertSame(0, $code, $err); + $this->assertStringContainsString('valid [' . $r['engine'] . ']', $out); + if ($r['engine'] === 'php-core') { + $this->assertStringContainsString('pre-check', $out); + $this->assertStringContainsString('not the official engine', $out); + } else { + $this->assertStringContainsString('official KoSIT/CEN schematron', $out); + } + + [$code, $out, $err] = self::runCli(['wsystem-einvoice', 'parse', '--json', '-'], $xml); + $this->assertSame(0, $code, $err); + $parsed = json_decode($out, true); + $this->assertSame('ubl', $parsed['syntax']); + $this->assertSame('INV-2026-001', $parsed['invoice']['invoice_number'] ?? $parsed['invoice']['number'] ?? null); + } finally { + @unlink($xmlFile); } - [$code, , $err] = self::runCli(['wsystem-einvoice', 'validate', '-'], ''); - $this->assertSame(2, $code); - $this->assertStringContainsString('validator module, which is not in this build yet', $err); + } - [$code, , $err] = self::runCli(['wsystem-einvoice', 'parse', '-'], ''); - $this->assertSame(2, $code); - $this->assertStringContainsString('parse is provided by the validator module', $err); + public function testValidateRejectsUnreadableInput(): void + { + [$code, $out, $err] = self::runCli(['wsystem-einvoice', 'validate', '-'], 'not an invoice'); + $this->assertSame(1, $code); + $this->assertSame('', $out); + $this->assertStringStartsWith('input error:', $err); + $this->assertStringNotContainsString('Stack trace', $err); + } + + public function testValidateReportsAnInvalidInvoice(): void + { + $path = __DIR__ . '/fixtures/validator/shared/invalid/ubl-xrechnung-BR-DE-15-no-buyer-reference.xml'; + [$code, $out, $err] = self::runCli(['wsystem-einvoice', 'validate', $path]); + $this->assertSame(1, $code, $out . $err); + $this->assertMatchesRegularExpression('/^invalid \[(php-core|saxonc)\]/', $out); + $this->assertStringContainsString('BR-DE-15', $out); } public function testBinVersion(): void diff --git a/tests/EInvoiceTest.php b/tests/EInvoiceTest.php index 66685f2..66470d3 100644 --- a/tests/EInvoiceTest.php +++ b/tests/EInvoiceTest.php @@ -25,9 +25,14 @@ public function testFacadeAndBuilderMatch(): void $this->assertSame($a['xml'], $b['xml']); $this->assertSame('955.00', $a['totals']['line_total']); $this->assertSame('UBL 2.1', $a['syntax']); - if (!class_exists(\WSystem\EInvoice\Validator\Validator::class)) { - $this->assertNull($a['valid']); - $this->assertSame('none', $a['validator']); + $this->assertTrue($a['valid']); + $this->assertContains($a['engine'], ['php-core', 'saxonc']); + $this->assertSame($a['engine'], $a['validator']); + if ($a['engine'] === 'php-core') { + $this->assertSame('pre-check', $a['conformance']); + $this->assertSame('core-subset', $a['checked']['EN16931']); + } else { + $this->assertSame('official', $a['conformance']); } } @@ -54,13 +59,19 @@ public function validate(string $data, string $rules = 'auto'): array $this->assertSame('BR-01', $r['errors'][0]['rule_id']); } - public function testValidateWithoutAModuleThrowsAClearError(): void + public function testValidateUsesTheDefaultEngine(): void { - if (class_exists(\WSystem\EInvoice\Validator\Validator::class)) { - $this->markTestSkipped('validator module is present'); + $xml = Builder::xml(self::sample()); + $r = (new EInvoice())->validate($xml); + $this->assertTrue($r['valid']); + $this->assertContains($r['engine'], ['php-core', 'saxonc']); + if ($r['engine'] === 'php-core') { + $this->assertSame('pre-check', $r['conformance']); + $this->assertSame('core-subset', $r['checked']['EN16931']); + $this->assertStringContainsString('pre-check', $r['rule_set']); + $this->assertStringContainsString('a pre-check, not a conformance check', $r['disclaimer']); + } else { + $this->assertSame('official', $r['conformance']); } - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('no validator configured'); - (new EInvoice())->validate(''); } }