@@ -17,6 +17,18 @@ Simple conversion of an array to a pretty view.
1717</p >
1818
1919
20+ ## Content
21+
22+ * [ Installation] ( #installation )
23+ * [ Introduction] ( #introduction )
24+ * [ Using] ( #using )
25+ * [ Saving numeric keys without alignment] ( #saving-numeric-keys-without-alignment )
26+ * [ Saving string keys without alignment] ( #saving-string-keys-without-alignment )
27+ * [ Saving numeric keys with alignment] ( #saving-numeric-keys-with-alignment )
28+ * [ Saving string keys with alignment] ( #saving-string-keys-with-alignment )
29+ * [ Copyright and License] ( #copyright-and-license )
30+
31+
2032## Installation
2133
2234To get the latest version of ` Pretty Array ` package, simply require the project using [ Composer] ( https://getcomposer.org ) :
@@ -247,6 +259,7 @@ Result:
247259]
248260```
249261
262+
250263### Saving string keys with alignment
251264
252265``` php
@@ -281,6 +294,50 @@ Result:
281294```
282295
283296
297+ ### Change key case
298+
299+ ``` php
300+ use Helldar\PrettyArray\Contracts\Caseable;
301+ use Helldar\PrettyArray\Services\Formatter;
302+
303+ $service = Formatter::make();
304+ $service->setCase(Caseable::PASCAL_CASE);
305+
306+ return $service->raw($array);
307+ ```
308+
309+ Result:
310+ ``` text
311+ [
312+ 'Foo' => 1,
313+ 'Bar' => 2,
314+ 'Baz' => 3,
315+ 'QweRty' => 'qaz',
316+ 'Baq' => [
317+ 0 => 'qwe',
318+ 1 => 'rty',
319+ 'Asd' => 'zxc',
320+ ],
321+ 'AsdFgh' => [
322+ 'FooBarBaz' => 'qwe',
323+ 2 => 'rty',
324+ 'QawSed' => 'zxc',
325+ ],
326+ 2 => 'iop',
327+ ]
328+ ```
329+
330+ The following options are available:
331+
332+ * camelCase (` Helldar\PrettyArray\Contracts\Caseable::CAMEL_CASE ` );
333+ * kebab-case (` Helldar\PrettyArray\Contracts\Caseable::KEBAB_CASE ` );
334+ * PascalCase (` Helldar\PrettyArray\Contracts\Caseable::PASCAL_CASE ` );
335+ * snake_case (` Helldar\PrettyArray\Contracts\Caseable::SNAKE_CASE ` );
336+ * no case (` Helldar\PrettyArray\Contracts\Caseable::NO_CASE ` ). By default;
337+
338+ ` NO_CASE ` means that key register processing will not be performed.
339+
340+
284341### Storing file
285342``` php
286343use Helldar\PrettyArray\Services\File;
0 commit comments