From cda53ade1a1df9ba758f6c3ae2addaf5c851524f Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Wed, 17 Apr 2019 01:03:05 +0200 Subject: [PATCH] Update README --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 4a98a9e..69b3ebb 100644 --- a/README.md +++ b/README.md @@ -400,6 +400,30 @@ Disallows exporting any custom object using direct property access and bound clo Disallows exporting closures. +### `VarExporter::INLINE_NUMERIC_SCALAR_ARRAY` + +Formats numeric arrays containing only scalar values on a single line: + +```php +VarExporter::export([ + 'one' => ['hello', 'world', 123, true, false, null, 7.5], + 'two' => ['hello', 'world', ['one', 'two', 'three']] +], VarExporter::INLINE_NUMERIC_SCALAR_ARRAY); +``` + +```php +[ + 'one' => ['hello', 'world', 123, true, false, null, 7.5], + 'two' => [ + 'hello', + 'world', + ['one', 'two', 'three'] + ] +] +``` + +Types considered scalar here are `int`, `bool`, `float`, `string` and `null`. + ## Error handling Any error occurring on `export()` will throw an `ExportException`: