Skip to content

Commit bc6629e

Browse files
author
Andrey Helldar
authored
Merge pull request #6 from TheDragonCode/3.x
[3.x] Changed namespace
2 parents 59fde7b + 2d27bdd commit bc6629e

24 files changed

+370
-188
lines changed

.codecov.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/coverage.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/phpunit.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ "7.2", "7.3", "7.4", "8.0" ]
12-
support: [ "2.0", "3.0", "4.0" ]
11+
php: [ "7.3", "7.4", "8.0" ]
1312

1413
name: PHP ${{ matrix.php }}, Support ${{ matrix.support }}
1514

@@ -24,13 +23,8 @@ jobs:
2423
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, bcmath
2524
coverage: none
2625

27-
- name: Composer self update
28-
run: composer self-update
29-
3026
- name: Install dependencies
31-
run: |
32-
composer require andrey-helldar/support:^${{ matrix.support }}
33-
composer update --prefer-stable --prefer-dist --no-progress --no-interaction
27+
run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction
3428

3529
- name: Execute tests
3630
run: sudo vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
2+
build/
23
vendor/
34

45
tests/files/source.php.*.php

README.md

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
11
# Pretty Array
22

3-
Simple conversion of an array to a pretty view.
4-
53
<img src="https://preview.dragon-code.pro/TheDragonCode/pretty-array.svg?brand=php" alt="Pretty Array"/>
64

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]
1210

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.
1812
1913

2014
## Installation
2115

2216
To get the latest version of `Pretty Array` package, simply require the project using [Composer](https://getcomposer.org):
2317

2418
```
25-
composer require andrey-helldar/pretty-array --dev
19+
composer require dragon-code/pretty-array
2620
```
2721

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:
2923

3024
```json
3125
{
32-
"require-dev": {
33-
"andrey-helldar/pretty-array": "^2.2"
26+
"require": {
27+
"dragon-code/pretty-array": "^3.0"
3428
}
3529
}
3630
```
3731

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+
3839
## Introduction
3940

4041
> 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 = [
7071
> Q: Why do you think this is bad?
7172
7273
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.
7476

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.
7678

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.
7981

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:
8183

8284
```php
8385
<?php
@@ -159,7 +161,7 @@ $array = array (
159161
### Saving numeric keys without alignment
160162

161163
```php
162-
use Helldar\PrettyArray\Services\Formatter;
164+
use DragonCode\PrettyArray\Services\Formatter;
163165

164166
$service = Formatter::make();
165167

@@ -191,7 +193,7 @@ Result:
191193
### Saving string keys without alignment
192194

193195
```php
194-
use Helldar\PrettyArray\Services\Formatter;
196+
use DragonCode\PrettyArray\Services\Formatter;
195197

196198
$service = Formatter::make();
197199
$service->setKeyAsString();
@@ -224,7 +226,7 @@ Result:
224226
### Saving numeric keys with alignment
225227

226228
```php
227-
use Helldar\PrettyArray\Services\Formatter;
229+
use DragonCode\PrettyArray\Services\Formatter;
228230

229231
$service = Formatter::make();
230232
$service->setEqualsAlign();
@@ -257,7 +259,7 @@ Result:
257259
### Saving string keys with alignment
258260

259261
```php
260-
use Helldar\PrettyArray\Services\Formatter;
262+
use DragonCode\PrettyArray\Services\Formatter;
261263

262264
$service = Formatter::make();
263265
$service->setKeyAsString();
@@ -291,7 +293,7 @@ Result:
291293
### Saving simple array
292294

293295
```php
294-
use Helldar\PrettyArray\Services\Formatter;
296+
use DragonCode\PrettyArray\Services\Formatter;
295297

296298
$service = Formatter::make();
297299
$service->setSimple();
@@ -324,8 +326,8 @@ Result:
324326
### Change key case
325327

326328
```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;
329331

330332
$service = Formatter::make();
331333
$service->setCase(Caseable::PASCAL_CASE);
@@ -357,20 +359,20 @@ Result:
357359

358360
The following options are available:
359361

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;
365367

366368
`NO_CASE` means that key register processing will not be performed.
367369

368370

369371
### Storing file
370372

371373
```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;
374376

375377
$service = Formatter::make();
376378

@@ -409,8 +411,18 @@ return [
409411
This package is licensed under the [MIT License](LICENSE).
410412

411413

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
413425

414-
Available as part of the Tidelift Subscription.
426+
[link_license]: LICENSE
415427

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

SECURITY.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

composer.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "andrey-helldar/pretty-array",
3-
"description": "Simple conversion of an array to a pretty view.",
2+
"name": "dragon-code/pretty-array",
3+
"description": "Simple conversion of an array to a pretty view",
44
"type": "library",
55
"license": "MIT",
6-
"keywords": ["pretty array", "pretty", "array"],
6+
"keywords": ["pretty array", "pretty", "array", "dragon code", "dragon", "andrey helldar"],
77
"support": {
8-
"issues": "https://github.com/andrey-helldar/pretty-array/issues",
9-
"source": "https://github.com/andrey-helldar/pretty-array"
8+
"issues": "https://github.com/TheDragonCode/pretty-array/issues",
9+
"source": "https://github.com/TheDragonCode/pretty-array"
1010
},
1111
"authors": [
1212
{
@@ -15,20 +15,24 @@
1515
}
1616
],
1717
"require": {
18-
"php": "^7.2.5|^8.0",
18+
"php": "^7.3|^8.0",
1919
"ext-dom": "*",
2020
"ext-mbstring": "*",
21-
"andrey-helldar/support": "^2.0|^3.0|^4.0"
21+
"dragon-code/contracts": "^2.6",
22+
"dragon-code/support": "^5.0"
2223
},
2324
"require-dev": {
24-
"phpunit/phpunit": "^8.0|^9.0"
25+
"phpunit/phpunit": "^9.0"
26+
},
27+
"conflict": {
28+
"andrey-helldar/pretty-array": "*"
2529
},
2630
"suggest": {
2731
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
2832
},
2933
"autoload": {
3034
"psr-4": {
31-
"Helldar\\PrettyArray\\": "src"
35+
"DragonCode\\PrettyArray\\": "src"
3236
}
3337
},
3438
"autoload-dev": {

phpunit.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
~ This file is part of the "dragon-code/pretty-array" project.
5+
~
6+
~ For the full copyright and license information, please view the LICENSE
7+
~ file that was distributed with this source code.
8+
~
9+
~ @author Andrey Helldar <[email protected]>
10+
~
11+
~ @copyright 2021 Andrey Helldar
12+
~
13+
~ @license MIT
14+
~
15+
~ @see https://github.com/TheDragonCode/pretty-array
16+
-->
17+
218
<phpunit
319
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
420
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

src/Concerns/HasCases.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
<?php
22

3-
namespace Helldar\PrettyArray\Concerns;
3+
/*
4+
* This file is part of the "dragon-code/pretty-array" project.
5+
*
6+
* For the full copyright and license information, please view the LICENSE
7+
* file that was distributed with this source code.
8+
*
9+
* @author Andrey Helldar <[email protected]>
10+
*
11+
* @copyright 2021 Andrey Helldar
12+
*
13+
* @license MIT
14+
*
15+
* @see https://github.com/TheDragonCode/pretty-array
16+
*/
417

5-
use Helldar\PrettyArray\Exceptions\UnknownCaseTypeException;
6-
use Helldar\Support\Facades\Helpers\Str;
18+
namespace DragonCode\PrettyArray\Concerns;
19+
20+
use DragonCode\PrettyArray\Exceptions\UnknownCaseTypeException;
21+
use DragonCode\Support\Facades\Helpers\Str;
722

823
trait HasCases
924
{
@@ -12,7 +27,7 @@ trait HasCases
1227
/**
1328
* @param int $type
1429
*
15-
* @throws \Helldar\PrettyArray\Exceptions\UnknownCaseTypeException
30+
* @throws \DragonCode\PrettyArray\Exceptions\UnknownCaseTypeException
1631
*/
1732
public function setCase(int $type = self::NO_CASE): void
1833
{

0 commit comments

Comments
 (0)