Skip to content
This repository was archived by the owner on Feb 14, 2023. It is now read-only.

Commit 1900adc

Browse files
author
Andrey Helldar
authored
Merge pull request #75 from TheDragonCode/10.x
Added `dragon-code/support` 6 support
2 parents d26fc18 + 43f3a7f commit 1900adc

File tree

13 files changed

+18
-19
lines changed

13 files changed

+18
-19
lines changed

.github/workflows/laravel-7.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ "7.3", "7.4", "8.0" ]
11+
php: [ "8.0" ]
1212
laravel: [ "7.0" ]
1313

1414
name: PHP ${{ matrix.php }}

.github/workflows/laravel-8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ "7.3", "7.4", "8.0", "8.1" ]
11+
php: [ "8.0", "8.1" ]
1212
laravel: [ "8.0" ]
1313

1414
name: PHP ${{ matrix.php }}

.github/workflows/symfony-4.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ "7.3", "7.4", "8.0" ]
11+
php: [ "8.0" ]
1212
symfony: [ "4.0" ]
1313

1414
name: PHP ${{ matrix.php }}

.github/workflows/symfony-5.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ "7.3", "7.4", "8.0", "8.1" ]
11+
php: [ "8.0", "8.1" ]
1212
symfony: [ "5.0" ]
1313

1414
name: PHP ${{ matrix.php }}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
"source": "https://github.com/TheDragonCode/api-response"
2626
},
2727
"require": {
28-
"php": "^7.2.5 || ^8.0",
28+
"php": "^8.0",
2929
"ext-json": "*",
3030
"dragon-code/contracts": "^2.2",
31-
"dragon-code/support": "^5.0",
31+
"dragon-code/support": "^6.0",
3232
"symfony/http-foundation": "^4.0 || ^5.0 || ^6.0"
3333
},
3434
"require-dev": {

src/Concerns/Errors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace DragonCode\ApiResponse\Concerns;
1919

20-
use DragonCode\Support\Facades\Helpers\Is;
20+
use DragonCode\Support\Facades\Types\Is;
2121

2222
trait Errors
2323
{

src/Parsers/Exception.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
namespace DragonCode\ApiResponse\Parsers;
1919

20-
use DragonCode\Support\Facades\Helpers\Call;
21-
use DragonCode\Support\Facades\Helpers\Instance;
20+
use DragonCode\Support\Facades\Instances\Call;
21+
use DragonCode\Support\Facades\Instances\Instance;
2222
use Exception as BaseException;
2323
use Throwable;
2424

src/Parsers/Laravel/Resource.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
namespace DragonCode\ApiResponse\Parsers\Laravel;
1919

2020
use DragonCode\ApiResponse\Parsers\Parser;
21-
use DragonCode\Support\Facades\Helpers\Ables\Arrayable;
2221
use DragonCode\Support\Facades\Helpers\Arr;
2322
use Illuminate\Http\JsonResponse;
2423

@@ -41,10 +40,10 @@ public function getWith(): array
4140
$data = $this->resourceData();
4241

4342
if ($this->hasData($data)) {
44-
return Arrayable::of($data)
43+
return Arr::of($data)
4544
->except('data')
4645
->merge($this->with)
47-
->get();
46+
->toArray();
4847
}
4948

5049
return $this->with;

src/Parsers/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
use DragonCode\ApiResponse\Services\Response;
2222
use DragonCode\Contracts\ApiResponse\Parseable;
2323
use DragonCode\Support\Concerns\Makeable;
24-
use DragonCode\Support\Facades\Helpers\Instance;
25-
use DragonCode\Support\Facades\Helpers\Is;
24+
use DragonCode\Support\Facades\Instances\Instance;
25+
use DragonCode\Support\Facades\Types\Is;
2626
use Exception as BaseException;
2727

2828
abstract class Parser implements Parseable

src/Support/Parser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
use DragonCode\ApiResponse\Parsers\Main;
2525
use DragonCode\Contracts\ApiResponse\Parseable;
2626
use DragonCode\Support\Concerns\Makeable;
27-
use DragonCode\Support\Facades\Helpers\Instance;
28-
use DragonCode\Support\Facades\Helpers\Is;
27+
use DragonCode\Support\Facades\Instances\Instance;
28+
use DragonCode\Support\Facades\Types\Is;
2929
use Exception;
3030
use Illuminate\Http\Resources\Json\JsonResource;
3131
use Illuminate\Validation\ValidationException;

src/Wrappers/Resolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,6 @@ protected function resolveData($data)
106106
return $data;
107107
}
108108

109-
return Arr::toArray($data);
109+
return Arr::resolve($data);
110110
}
111111
}

src/Wrappers/Wrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected function split(): void
128128
$with = $this->getWith();
129129

130130
if (is_array($data) || is_object($data)) {
131-
$array = Arr::toArray($data);
131+
$array = Arr::resolve($data);
132132

133133
if ($this->wrap || ! empty($with) || $this->isError($array)) {
134134
$this->setData($this->unpackData($array));

tests/Fixtures/Entities/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
namespace Tests\Fixtures\Entities;
1919

20-
use DragonCode\Support\Facades\Helpers\Instance;
20+
use DragonCode\Support\Facades\Instances\Instance;
2121
use Illuminate\Testing\TestResponse;
2222
use Symfony\Component\HttpFoundation\JsonResponse;
2323
use Symfony\Component\HttpFoundation\Response as MainResponse;

0 commit comments

Comments
 (0)