This commit is contained in:
Toby Zerner 2021-07-22 12:28:59 +09:30
parent dc8ec9ee1d
commit f2aac7f78e
3 changed files with 4 additions and 5 deletions

View File

@ -131,7 +131,6 @@ trait SavesData
*/ */
private function assertFieldsWritable(array $data, $model, Context $context) private function assertFieldsWritable(array $data, $model, Context $context)
{ {
foreach ($this->resource->getSchema()->getFields() as $field) { foreach ($this->resource->getSchema()->getFields() as $field) {
if (! has_value($data, $field)) { if (! has_value($data, $field)) {
continue; continue;

View File

@ -123,7 +123,7 @@ class Index
return $selfUrl.($queryString ? '?'.$queryString : ''); return $selfUrl.($queryString ? '?'.$queryString : '');
} }
private function buildPaginationLinks(Request $request, int $offset, ?int $limit, int $count, ?int $total) private function buildPaginationLinks(Request $request, int $offset, ?int $limit, int $count, ?int $total): array
{ {
$paginationLinks = []; $paginationLinks = [];
$schema = $this->resource->getSchema(); $schema = $this->resource->getSchema();
@ -153,7 +153,7 @@ class Index
return $paginationLinks; return $paginationLinks;
} }
private function sort($query, Context $context) private function sort($query, Context $context): void
{ {
$schema = $this->resource->getSchema(); $schema = $this->resource->getSchema();
@ -202,7 +202,7 @@ class Index
return $sort; return $sort;
} }
private function paginate($query, Context $context) private function paginate($query, Context $context): array
{ {
$schema = $this->resource->getSchema(); $schema = $this->resource->getSchema();
$queryParams = $context->getRequest()->getQueryParams(); $queryParams = $context->getRequest()->getQueryParams();

View File

@ -1,7 +1,7 @@
<?php <?php
/* /*
* This file is part of Forust. * This file is part of tobyz/json-api-server.
* *
* (c) Toby Zerner <toby.zerner@gmail.com> * (c) Toby Zerner <toby.zerner@gmail.com>
* *