silarhi / zugferd-factur-x
XML generator for ZUGFeRD / Factur-X / XRechnung written in PHP. Convert PHP Objects to XML and back.
2.0.0
2024-02-09 17:57 UTC
Requires
- php: >=8.0
- ext-dom: *
- jms/serializer: ^3.18
Requires (Dev)
- ext-libxml: *
- friendsofphp/php-cs-fixer: ^3.16
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.6.15
- rector/rector: ^1.0
Suggests
- ext-libxml: Needed for XSD validation
This package is auto-updated.
Last update: 2024-11-13 14:05:41 UTC
README
XML generator for ZUGFeRD / Factur-X / XRechnung written in PHP. Convert PHP Objects to XML and back.
Installation
The recommended way of installing this library is using Composer.
Add this repository to your composer information using the following command
composer require silarhi/zugferd-factur-x
Usage ZUGFeRD v2.1
Convert XML to PHP Objects:
use src\Reader; $xml = file_get_contents('factur-x.xml'); $obj = Reader::create()->transform($xml);
Convert PHP Objects to XML:
use src\Builder; $obj = ...; $xml = Builder::create()->transform($obj); echo $xml; // Zugferd XML.
Contributing
Please feel free to send bug reports and pull requests.
License
Published as open source under the terms of MIT License.