Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot authored and jiannei committed Oct 11, 2023
1 parent ff5d191 commit f006993
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Support/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function data($data, ?string $message, int $code, $errors = null): array
public function paginator(AbstractPaginator|AbstractCursorPaginator $resource, $transformer = null, $resourceName = null): array
{
$fractal = fractal()
->collection($resource, $transformer ?: fn($item) => $item->toArray(), $resourceName)
->collection($resource, $transformer ?: fn ($item) => $item->toArray(), $resourceName)
->serializeWith(DataArraySerializer::class);

return tap($fractal, $this->formatCollection($resource))->toArray();
Expand Down Expand Up @@ -122,7 +122,7 @@ public function resourceCollection(ResourceCollection $collection, $transformer
*/
public function jsonResource(JsonResource $resource, $transformer = null, $resourceName = null): array
{
$data = value($this->formatJsonResource(),$resource);
$data = value($this->formatJsonResource(), $resource);

return fractal()
->item($data, $transformer ?: fn () => $data, $resourceName)
Expand Down Expand Up @@ -190,7 +190,7 @@ protected function formatJsonResource(): \Closure
/**
* Format paginator data.
*
* @param $collection
* @param $collection
* @return \Closure
*/
protected function formatCollection($collection): \Closure
Expand Down
10 changes: 5 additions & 5 deletions tests/SuccessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function testSuccessWithPaginatedData()

$this->assertEquals(200, $response->status());

$formatData = Arr::map($users->items(),fn($item) => [
$formatData = Arr::map($users->items(), fn ($item) => [
'nickname' => $item->name,
'email' => $item->email,
]);
Expand Down Expand Up @@ -241,7 +241,7 @@ public function testLengthAwarePaginator()

$this->assertEquals(200, $response->status());

$formatData = Arr::map($users->items(),fn($item) => $item->toArray());
$formatData = Arr::map($users->items(), fn ($item) => $item->toArray());

$data = [
'data' => $formatData,
Expand Down Expand Up @@ -279,7 +279,7 @@ public function testSimplePaginator()

$this->assertEquals(200, $response->status());

$formatData = Arr::map($users->items(),fn($item) => $item->toArray());
$formatData = Arr::map($users->items(), fn ($item) => $item->toArray());

$data = [
'data' => $formatData,
Expand Down Expand Up @@ -315,7 +315,7 @@ public function testCursorPaginator()

$this->assertEquals(200, $response->status());

$formatData = Arr::map($users->items(),fn($item) => $item->toArray());
$formatData = Arr::map($users->items(), fn ($item) => $item->toArray());

$data = [
'data' => $formatData,
Expand All @@ -324,7 +324,7 @@ public function testCursorPaginator()
'current' => $users->cursor()?->encode(),
'prev' => $users->previousCursor()?->encode(),
'next' => $users->nextCursor()?->encode(),
'count' => count($users->items())
'count' => count($users->items()),
],
],
];
Expand Down

0 comments on commit f006993

Please sign in to comment.