Skip to content

Commit

Permalink
V0.3.0 (#11)
Browse files Browse the repository at this point in the history
* Fix property name for ActualDeliveryDate in Delivery UBL
* Add string value object to tim string values in serialization (not by default)
* Add new handlers to handle strings
* Add new method to create a ConfiguredSerializer with Handlers
* Add phpstan-strict-rules
* Update phpstan config
* Add converted CII to UBL examples
* Add new test case to read that converted examples
* Update composer dependencies
* Remove version from composer.json
* Remove PHPUnit11 deprecations
* Add to README.md
* Use JMS imports in various CII models
  • Loading branch information
BolZer authored Oct 19, 2024
1 parent 148b287 commit d346f04
Show file tree
Hide file tree
Showing 94 changed files with 3,994 additions and 404 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ if ($document instanceof CrossIndustryInvoice) {

You can refer to the [tests](https://github.com/easybill/e-invoicing/tree/main/tests/Integration) in this repository for examples of using this library.

## Customization
This library offers some degree of customization. You may create a customized Reader, Transformer or Writer.
By default, the library does not trim whitespaces around values. This is true for values which do not end as enums.
If you want to add that the functionality to trim the values you may refer to this [test](https://github.com/easybill/e-invoicing/tree/main/tests/Integration/SerializerTest).

```PHP
$transformer = new Transformer(ConfiguredSerializer::createWithHandlers([
new TrimStringValueHandler(),
new CountryCodeEnumHandler(),
new CurrencyCodeEnumHandler(),
new DocumentTypeEnumHandler(),
new ReferenceQualifierEnumHandler(),
new UnitCodeEnumHandler(),
new MimeTypeEnumHandler(),
new ElectronicAddressSchemeIdentifierEnumHandler(),
]));
```


This allows to register custom handlers, or even add handlers which the library offers but does not include by default (yet)
like the TrimStringValueHandler.

## Considerations

### Limitations
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "easybill/e-invoicing",
"version": "0.2.3",
"description": "A package to read and create EN16931 e-invoices or CIUS like: XRechnung, ZUGFeRD etc.",
"type": "library",
"license": "MIT",
Expand Down Expand Up @@ -48,7 +47,9 @@
"pestphp/pest": "^2.35",
"phpstan/phpstan": "^1.12",
"friendsofphp/php-cs-fixer": "^3.64",
"guzzlehttp/guzzle": "^7.9"
"guzzlehttp/guzzle": "^7.9",
"phpstan/phpstan-strict-rules": "^1.6",
"symfony/finder": "^7.1"
},
"config": {
"platform-check": false,
Expand Down
Loading

0 comments on commit d346f04

Please sign in to comment.