-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle
JSON_PRETTY_PRINT
option with the JSON normalizer
Formats the JSON with whitespaces and line breaks. ```php $input = [ 'value' => 'foo', 'list' => [ 'foo', 42, ['sub'] ], 'associative' => [ 'value' => 'foo', 'sub' => [ 'string' => 'foo', 'integer' => 42, ], ], ]; (new \CuyZ\Valinor\MapperBuilder()) ->normalizer(\CuyZ\Valinor\Normalizer\Format::json()) ->withOptions(\JSON_PRETTY_PRINT) ->normalize($input); // Result: // { // "value": "foo", // "list": [ // "foo", // 42, // [ // "sub" // ] // ], // "associative": { // "value": "foo", // "sub": { // "string": "foo", // "integer": 42 // } // } // }
- Loading branch information
Showing
4 changed files
with
86 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters