1
0
mirror of https://github.com/halaxa/json-machine.git synced 2025-02-21 22:52:21 +01:00
json-machine/CHANGELOG.md

26 lines
1.2 KiB
Markdown
Raw Normal View History

2020-04-17 12:43:32 +02:00
# master
## New features
- [Custom decoder](README.md#custom-decoder)
2020-04-17 13:08:40 +02:00
- `ext-json` is not required in `composer.json` anymore, because custom decoder might not need it.
However **built-in decoders depend on it** so it must be present if you use them.
2020-11-08 12:55:44 +01:00
- PHP 8 support (thanks @snapshotpl)
2020-04-17 12:43:32 +02:00
## BC breaks
2020-04-17 13:08:40 +02:00
- Function `httpClientChunks()` is **deprecated** so that compatibility with Symfony HttpClient
2020-11-08 12:55:44 +01:00
is not on the shoulders of JSON Machine maintainer. The code is simple and everyone can make their own
2020-04-17 13:08:40 +02:00
function and maintain it. The code was moved to [examples](src/examples/symfonyHttpClient.php).
- Function `objects()` is **deprecated**. The way `objects()` works is that it casts decoded arrays
to objects. It brings some unnecessary overhead and risks on huge datasets.
2020-11-08 12:55:44 +01:00
Alternative is to use `ExtJsonDecoder` which decodes items as objects by default (same as `json_decode`).
2020-04-17 13:08:40 +02:00
```php
<?php
use JsonMachine\JsonDecoder\ExtJsonDecoder;
use JsonMachine\JsonMachine;
2020-11-08 12:55:44 +01:00
$jsonMachine = JsonMachine::fromFile('path/to.json', '', new ExtJsonDecoder);
2020-04-17 13:08:40 +02:00
```
Therefore no additional casting is required.
2020-04-17 12:43:32 +02:00
- Invalid json object keys will now throw and won't be ignored anymore.
## Fixed bugs
- Decoding of json object keys checks for errors and does not silently ignore them.