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

Added dragon-code/support 6 support #75

Merged
merged 1 commit into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/laravel-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0" ]
php: [ "8.0" ]
laravel: [ "7.0" ]

name: PHP ${{ matrix.php }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/laravel-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0", "8.1" ]
php: [ "8.0", "8.1" ]
laravel: [ "8.0" ]

name: PHP ${{ matrix.php }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/symfony-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0" ]
php: [ "8.0" ]
symfony: [ "4.0" ]

name: PHP ${{ matrix.php }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/symfony-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [ "7.3", "7.4", "8.0", "8.1" ]
php: [ "8.0", "8.1" ]
symfony: [ "5.0" ]

name: PHP ${{ matrix.php }}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"source": "https://github.com/TheDragonCode/api-response"
},
"require": {
"php": "^7.2.5 || ^8.0",
"php": "^8.0",
"ext-json": "*",
"dragon-code/contracts": "^2.2",
"dragon-code/support": "^5.0",
"dragon-code/support": "^6.0",
"symfony/http-foundation": "^4.0 || ^5.0 || ^6.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace DragonCode\ApiResponse\Concerns;

use DragonCode\Support\Facades\Helpers\Is;
use DragonCode\Support\Facades\Types\Is;

trait Errors
{
Expand Down
4 changes: 2 additions & 2 deletions src/Parsers/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

namespace DragonCode\ApiResponse\Parsers;

use DragonCode\Support\Facades\Helpers\Call;
use DragonCode\Support\Facades\Helpers\Instance;
use DragonCode\Support\Facades\Instances\Call;
use DragonCode\Support\Facades\Instances\Instance;
use Exception as BaseException;
use Throwable;

Expand Down
5 changes: 2 additions & 3 deletions src/Parsers/Laravel/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
namespace DragonCode\ApiResponse\Parsers\Laravel;

use DragonCode\ApiResponse\Parsers\Parser;
use DragonCode\Support\Facades\Helpers\Ables\Arrayable;
use DragonCode\Support\Facades\Helpers\Arr;
use Illuminate\Http\JsonResponse;

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

if ($this->hasData($data)) {
return Arrayable::of($data)
return Arr::of($data)
->except('data')
->merge($this->with)
->get();
->toArray();
}

return $this->with;
Expand Down
4 changes: 2 additions & 2 deletions src/Parsers/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use DragonCode\ApiResponse\Services\Response;
use DragonCode\Contracts\ApiResponse\Parseable;
use DragonCode\Support\Concerns\Makeable;
use DragonCode\Support\Facades\Helpers\Instance;
use DragonCode\Support\Facades\Helpers\Is;
use DragonCode\Support\Facades\Instances\Instance;
use DragonCode\Support\Facades\Types\Is;
use Exception as BaseException;

abstract class Parser implements Parseable
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
use DragonCode\ApiResponse\Parsers\Main;
use DragonCode\Contracts\ApiResponse\Parseable;
use DragonCode\Support\Concerns\Makeable;
use DragonCode\Support\Facades\Helpers\Instance;
use DragonCode\Support\Facades\Helpers\Is;
use DragonCode\Support\Facades\Instances\Instance;
use DragonCode\Support\Facades\Types\Is;
use Exception;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Validation\ValidationException;
Expand Down
2 changes: 1 addition & 1 deletion src/Wrappers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ protected function resolveData($data)
return $data;
}

return Arr::toArray($data);
return Arr::resolve($data);
}
}
2 changes: 1 addition & 1 deletion src/Wrappers/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected function split(): void
$with = $this->getWith();

if (is_array($data) || is_object($data)) {
$array = Arr::toArray($data);
$array = Arr::resolve($data);

if ($this->wrap || ! empty($with) || $this->isError($array)) {
$this->setData($this->unpackData($array));
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Entities/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Tests\Fixtures\Entities;

use DragonCode\Support\Facades\Helpers\Instance;
use DragonCode\Support\Facades\Instances\Instance;
use Illuminate\Testing\TestResponse;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response as MainResponse;
Expand Down