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 5b3f210 commit 01cf246
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Support/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function paginator(AbstractPaginator|AbstractCursorPaginator $resource):
{
return [
'data' => $resource->toArray()['data'],
'meta' => $this->formatMeta($resource)
'meta' => $this->formatMeta($resource),
];
}

Expand All @@ -97,7 +97,7 @@ public function resourceCollection(ResourceCollection $collection): array
{
return array_filter([
'data' => $collection->resolve(),
'meta' => $this->formatMeta($collection->resource)
'meta' => $this->formatMeta($collection->resource),
]);
}

Expand All @@ -109,7 +109,7 @@ public function resourceCollection(ResourceCollection $collection): array
*/
public function jsonResource(JsonResource $resource): array
{
return value($this->formatJsonResource(),$resource);
return value($this->formatJsonResource(), $resource);
}

/**
Expand All @@ -121,7 +121,7 @@ public function jsonResource(JsonResource $resource): array
*/
protected function formatMessage(int $code, ?string $message): ?string
{
if (!$message && class_exists($enumClass = Config::get('response.enum'))) {
if (! $message && class_exists($enumClass = Config::get('response.enum'))) {
$message = $enumClass::fromValue($code)->description;
}

Expand Down Expand Up @@ -186,7 +186,7 @@ protected function formatMeta($collection): array
'prev' => $collection->previousCursor()?->encode(),
'next' => $collection->nextCursor()?->encode(),
'count' => count($collection->items()),
]
],
],
$collection instanceof LengthAwarePaginator => [
'pagination' => [
Expand Down Expand Up @@ -227,7 +227,7 @@ protected function formatDataFields(array $data): array
$formatConfig = \config('response.format.config', []);

foreach ($formatConfig as $key => $config) {
if (!Arr::has($data, $key)) {
if (! Arr::has($data, $key)) {
continue;
}

Expand All @@ -240,7 +240,7 @@ protected function formatDataFields(array $data): array
$key = $alias;
}

if (!$show) {
if (! $show) {
$data = Arr::except($data, $key);
}
}
Expand Down

0 comments on commit 01cf246

Please sign in to comment.