symfony/symfony — pull request #4283 by scoolen (2012-05-14 18:42:17+00:00)
Title: [Serializer][JsonEncoder] Exposed json_encode and json_decode params

In `JsonEncoder::decode()` you are unable to change the `$assoc` parameter from `json_decode`. I created two sub-classes that handle JSON encoding and decoding while exposing all the available parameters from `json_encode` and `json_decode`. You can now do this:

```php
$jsonEncoder = new JsonEncoder(new JsonEncode(JSON_HEX_TAG), new JsonDecode(true, 1024));
$serializer = new Serializer(array(), array($jsonEncoder));
```

Additionally I made `json_last_error()` available from `JsonEncoder`:
```php
$jsonEncoder->getLastEncodingError();
$jsonEncoder->getLastDecodingError();
```

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: N/A
Todo: -
License of the code: MIT
Documentation PR: -