|
1 | 1 | # Pretty Array
|
2 | 2 |
|
3 |
| -Simple conversion of an array to a pretty view. |
4 |
| - |
5 | 3 | <img src="https://preview.dragon-code.pro/TheDragonCode/pretty-array.svg?brand=php" alt="Pretty Array"/>
|
6 | 4 |
|
7 |
| -<p align="center"> |
8 |
| - <a href="https://packagist.org/packages/andrey-helldar/pretty-array"><img src="https://img.shields.io/packagist/dt/andrey-helldar/pretty-array.svg?style=flat-square" alt="Total Downloads" /></a> |
9 |
| - <a href="https://packagist.org/packages/andrey-helldar/pretty-array"><img src="https://poser.pugx.org/andrey-helldar/pretty-array/v/stable?format=flat-square" alt="Latest Stable Version" /></a> |
10 |
| - <a href="https://packagist.org/packages/andrey-helldar/pretty-array"><img src="https://poser.pugx.org/andrey-helldar/pretty-array/v/unstable?format=flat-square" alt="Latest Unstable Version" /></a> |
11 |
| -</p> |
| 5 | +[![Stable Version][badge_stable]][link_packagist] |
| 6 | +[![Unstable Version][badge_unstable]][link_packagist] |
| 7 | +[![Total Downloads][badge_downloads]][link_packagist] |
| 8 | +[![Github Workflow Status][badge_build]][link_build] |
| 9 | +[![License][badge_license]][link_license] |
12 | 10 |
|
13 |
| -<p align="center"> |
14 |
| - <a href="https://styleci.io/repos/219764491"><img src="https://styleci.io/repos/219764491/shield" alt="StyleCI" /></a> |
15 |
| - <a href="https://travis-ci.org/andrey-helldar/pretty-array"><img src="https://travis-ci.org/andrey-helldar/pretty-array.svg?branch=master" alt="Travis-CI" /></a> |
16 |
| - <a href="LICENSE"><img src="https://poser.pugx.org/andrey-helldar/pretty-array/license?format=flat-square" alt="License" /></a> |
17 |
| -</p> |
| 11 | +> Simple conversion of an array to a pretty view. |
18 | 12 |
|
19 | 13 |
|
20 | 14 | ## Installation
|
21 | 15 |
|
22 | 16 | To get the latest version of `Pretty Array` package, simply require the project using [Composer](https://getcomposer.org):
|
23 | 17 |
|
24 | 18 | ```
|
25 |
| -composer require andrey-helldar/pretty-array --dev |
| 19 | +composer require dragon-code/pretty-array |
26 | 20 | ```
|
27 | 21 |
|
28 |
| -Instead, you may of course manually update your `require-dev` block and run `composer update` if you so choose: |
| 22 | +Instead, you may of course manually update your `require` block and run `composer update` if you so choose: |
29 | 23 |
|
30 | 24 | ```json
|
31 | 25 | {
|
32 |
| - "require-dev": { |
33 |
| - "andrey-helldar/pretty-array": "^2.2" |
| 26 | + "require": { |
| 27 | + "dragon-code/pretty-array": "^3.0" |
34 | 28 | }
|
35 | 29 | }
|
36 | 30 | ```
|
37 | 31 |
|
| 32 | +### Upgrade from `andrey-helldar/pretty-array` |
| 33 | + |
| 34 | +1. Replace `"andrey-helldar/pretty-array": "^2.0"` with `"dragon-code/pretty-array": "^3.0"` in the `composer.json` file; |
| 35 | +2. Replace `Helldar\PrettyArray\Contracts\Caseable` with `DragonCode\Contracts\Pretty\Arr\Caseable`; |
| 36 | +3. Replace `Helldar\PrettyArray` namespace prefix with `DragonCode\PrettyArray`; |
| 37 | +4. Call the `composer update` console command. |
| 38 | + |
38 | 39 | ## Introduction
|
39 | 40 |
|
40 | 41 | > Q: Why did you create this package when there is a cooler [symfony/var-exporter](https://github.com/symfony/var-exporter)?
|
@@ -70,14 +71,15 @@ $array = [
|
70 | 71 | > Q: Why do you think this is bad?
|
71 | 72 |
|
72 | 73 | This package has a framework-independent base. However, it was originally developed as an assistant for
|
73 |
| -package [lang-translations](https://github.com/andrey-helldar/lang-translations). |
| 74 | +the [Laravel Lang: HTTP Statuses](https://github.com/Laravel-Lang/http-statuses) |
| 75 | +package. |
74 | 76 |
|
75 |
| -This package allows you to publish language translations for the Laravel framework. |
| 77 | +This package allows you to publish language translations of the HTTP Status Codes for the Laravel and Lumen frameworks. |
76 | 78 |
|
77 |
| -A feature of the framework is that IDEs that help with development do not know how to read the numeric keys of arrays of translation files, so it was necessary to translate them |
78 |
| -into a text equivalent. |
| 79 | +A feature of the framework is that IDEs that help with development do not know how to read the numeric keys of arrays of translation files, so it was necessary to translate |
| 80 | +theminto a text equivalent. |
79 | 81 |
|
80 |
| -This behavior includes [errors.php](https://github.com/andrey-helldar/lang-translations/blob/master/src/lang/en/errors.php) file: |
| 82 | +This behavior includes [http-statuses.php](https://github.com/Laravel-Lang/http-statuses/blob/main/source/http-statuses.php) file: |
81 | 83 |
|
82 | 84 | ```php
|
83 | 85 | <?php
|
@@ -159,7 +161,7 @@ $array = array (
|
159 | 161 | ### Saving numeric keys without alignment
|
160 | 162 |
|
161 | 163 | ```php
|
162 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 164 | +use DragonCode\PrettyArray\Services\Formatter; |
163 | 165 |
|
164 | 166 | $service = Formatter::make();
|
165 | 167 |
|
@@ -191,7 +193,7 @@ Result:
|
191 | 193 | ### Saving string keys without alignment
|
192 | 194 |
|
193 | 195 | ```php
|
194 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 196 | +use DragonCode\PrettyArray\Services\Formatter; |
195 | 197 |
|
196 | 198 | $service = Formatter::make();
|
197 | 199 | $service->setKeyAsString();
|
@@ -224,7 +226,7 @@ Result:
|
224 | 226 | ### Saving numeric keys with alignment
|
225 | 227 |
|
226 | 228 | ```php
|
227 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 229 | +use DragonCode\PrettyArray\Services\Formatter; |
228 | 230 |
|
229 | 231 | $service = Formatter::make();
|
230 | 232 | $service->setEqualsAlign();
|
@@ -257,7 +259,7 @@ Result:
|
257 | 259 | ### Saving string keys with alignment
|
258 | 260 |
|
259 | 261 | ```php
|
260 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 262 | +use DragonCode\PrettyArray\Services\Formatter; |
261 | 263 |
|
262 | 264 | $service = Formatter::make();
|
263 | 265 | $service->setKeyAsString();
|
@@ -291,7 +293,7 @@ Result:
|
291 | 293 | ### Saving simple array
|
292 | 294 |
|
293 | 295 | ```php
|
294 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 296 | +use DragonCode\PrettyArray\Services\Formatter; |
295 | 297 |
|
296 | 298 | $service = Formatter::make();
|
297 | 299 | $service->setSimple();
|
@@ -324,8 +326,8 @@ Result:
|
324 | 326 | ### Change key case
|
325 | 327 |
|
326 | 328 | ```php
|
327 |
| -use Helldar\PrettyArray\Contracts\Caseable; |
328 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 329 | +use DragonCode\Contracts\Pretty\Arr\Caseable; |
| 330 | +use DragonCode\PrettyArray\Services\Formatter; |
329 | 331 |
|
330 | 332 | $service = Formatter::make();
|
331 | 333 | $service->setCase(Caseable::PASCAL_CASE);
|
@@ -357,20 +359,20 @@ Result:
|
357 | 359 |
|
358 | 360 | The following options are available:
|
359 | 361 |
|
360 |
| -* camelCase (`Helldar\PrettyArray\Contracts\Caseable::CAMEL_CASE`); |
361 |
| -* kebab-case (`Helldar\PrettyArray\Contracts\Caseable::KEBAB_CASE`); |
362 |
| -* PascalCase (`Helldar\PrettyArray\Contracts\Caseable::PASCAL_CASE`); |
363 |
| -* snake_case (`Helldar\PrettyArray\Contracts\Caseable::SNAKE_CASE`); |
364 |
| -* no case (`Helldar\PrettyArray\Contracts\Caseable::NO_CASE`). By default; |
| 362 | +* camelCase (`DragonCode\Contracts\Pretty\Arr\Caseable::CAMEL_CASE`); |
| 363 | +* kebab-case (`DragonCode\Contracts\Pretty\Arr\Caseable::KEBAB_CASE`); |
| 364 | +* PascalCase (`DragonCode\Contracts\Pretty\Arr\Caseable::PASCAL_CASE`); |
| 365 | +* snake_case (`DragonCode\Contracts\Pretty\Arr\Caseable::SNAKE_CASE`); |
| 366 | +* no case (`DragonCode\Contracts\Pretty\Arr\Caseable::NO_CASE`). By default; |
365 | 367 |
|
366 | 368 | `NO_CASE` means that key register processing will not be performed.
|
367 | 369 |
|
368 | 370 |
|
369 | 371 | ### Storing file
|
370 | 372 |
|
371 | 373 | ```php
|
372 |
| -use Helldar\PrettyArray\Services\File; |
373 |
| -use Helldar\PrettyArray\Services\Formatter; |
| 374 | +use DragonCode\PrettyArray\Services\File; |
| 375 | +use DragonCode\PrettyArray\Services\Formatter; |
374 | 376 |
|
375 | 377 | $service = Formatter::make();
|
376 | 378 |
|
@@ -409,8 +411,18 @@ return [
|
409 | 411 | This package is licensed under the [MIT License](LICENSE).
|
410 | 412 |
|
411 | 413 |
|
412 |
| -## For Enterprise |
| 414 | +[badge_build]: https://img.shields.io/github/workflow/status/TheDragonCode/pretty-array/phpunit?style=flat-square |
| 415 | + |
| 416 | +[badge_downloads]: https://img.shields.io/packagist/dt/dragon-code/pretty-array.svg?style=flat-square |
| 417 | + |
| 418 | +[badge_license]: https://img.shields.io/packagist/l/dragon-code/pretty-array.svg?style=flat-square |
| 419 | + |
| 420 | +[badge_stable]: https://img.shields.io/github/v/release/TheDragonCode/pretty-array?label=stable&style=flat-square |
| 421 | + |
| 422 | +[badge_unstable]: https://img.shields.io/badge/unstable-dev--main-orange?style=flat-square |
| 423 | + |
| 424 | +[link_build]: https://github.com/TheDragonCode/pretty-array/actions |
413 | 425 |
|
414 |
| -Available as part of the Tidelift Subscription. |
| 426 | +[link_license]: LICENSE |
415 | 427 |
|
416 |
| -The maintainers of `andrey-helldar/pretty-array` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more](https://tidelift.com/subscription/pkg/packagist-andrey-helldar-pretty-array?utm_source=packagist-andrey-helldar-pretty-array&utm_medium=referral&utm_campaign=enterprise&utm_term=repo). |
| 428 | +[link_packagist]: https://packagist.org/packages/dragon-code/pretty-array |
0 commit comments