Skip to content

Commit

Permalink
test: success
Browse files Browse the repository at this point in the history
  • Loading branch information
jiannei committed Oct 13, 2023
1 parent 861c1a7 commit 3c1ca0a
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 233 deletions.
3 changes: 2 additions & 1 deletion src/Support/Facades/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Jiannei\Response\Laravel\Support\Facades;

use Illuminate\Contracts\Pagination\Paginator;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Http\Resources\Json\ResourceCollection;
Expand All @@ -20,7 +21,7 @@

/**
* @method static array|\Jiannei\Response\Laravel\Support\Format data($data = null)
* @method static array paginator(AbstractPaginator|AbstractCursorPaginator $resource)
* @method static array paginator(AbstractPaginator|AbstractCursorPaginator|Paginator $resource)
* @method static array resourceCollection(ResourceCollection $collection)
* @method static array jsonResource(JsonResource $resource)
* @method static JsonResponse response()
Expand Down
6 changes: 3 additions & 3 deletions src/Support/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
use Illuminate\Pagination\AbstractCursorPaginator;
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Pagination\CursorPaginator;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Contracts\Pagination\Paginator;

class Format
{
Expand Down Expand Up @@ -75,10 +75,10 @@ public function data($data = null): static|array
/**
* Format paginator data.
*
* @param AbstractPaginator|AbstractCursorPaginator $resource
* @param AbstractPaginator|AbstractCursorPaginator|Paginator $resource
* @return array
*/
public function paginator(AbstractPaginator|AbstractCursorPaginator $resource): array
public function paginator(AbstractPaginator|AbstractCursorPaginator|Paginator $resource): array
{
return [
'data' => $resource->toArray()['data'],
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected function defineEnvironment($app)
$config->set('response.locale', 'enums.'.ResponseEnum::class);
});

if ($this instanceof \P\Tests\Unit\FormatTest) {
if ($this instanceof \P\Tests\Unit\CustomFormatTest) {
$app['config']->set('response.format', [
'class' => \Jiannei\Response\Laravel\Tests\Support\Format::class,
]);
Expand Down
File renamed without changes.
Loading

0 comments on commit 3c1ca0a

Please sign in to comment.