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)
{
foreach ($this->resource->getSchema()->getFields() as $field) {
if (! has_value($data, $field)) {
continue;

View File

@ -123,7 +123,7 @@ class Index
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 = [];
$schema = $this->resource->getSchema();
@ -153,7 +153,7 @@ class Index
return $paginationLinks;
}
private function sort($query, Context $context)
private function sort($query, Context $context): void
{
$schema = $this->resource->getSchema();
@ -202,7 +202,7 @@ class Index
return $sort;
}
private function paginate($query, Context $context)
private function paginate($query, Context $context): array
{
$schema = $this->resource->getSchema();
$queryParams = $context->getRequest()->getQueryParams();

View File

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