Skip to content

Commit

Permalink
README: add a configuration example for IdInterfaceNormalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
xthiago committed Jun 19, 2023
1 parent 0c698b8 commit a7cfd4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,18 @@ class Product
This library includes a class [`IdInterfaceNormalizer`](src/Serializer/Symfony/IdInterfaceNormalizer.php) able to
normalize and denormalize instances of `Id` value object.

To use that normalizer, you need to pass it as an argument of `Serializer` class constructor:

```php
$serializer = new Serializer(
normalizers: [
new IdInterfaceNormalizer(), // <---
// others normalizers...
],
encoders: [new JsonEncoder()]
);
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Expand Down

0 comments on commit a7cfd4c

Please sign in to comment.