From f2aac7f78e1ff737c8e2b867755ea6e4aa4f1285 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 22 Jul 2021 12:28:59 +0930 Subject: [PATCH] Clean up --- src/Endpoint/Concerns/SavesData.php | 1 - src/Endpoint/Index.php | 6 +++--- src/Schema/Concerns/HasMeta.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Endpoint/Concerns/SavesData.php b/src/Endpoint/Concerns/SavesData.php index bdb83cc..86df7e8 100644 --- a/src/Endpoint/Concerns/SavesData.php +++ b/src/Endpoint/Concerns/SavesData.php @@ -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; diff --git a/src/Endpoint/Index.php b/src/Endpoint/Index.php index 7f53440..04627e3 100644 --- a/src/Endpoint/Index.php +++ b/src/Endpoint/Index.php @@ -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(); diff --git a/src/Schema/Concerns/HasMeta.php b/src/Schema/Concerns/HasMeta.php index 1c9961d..b482586 100644 --- a/src/Schema/Concerns/HasMeta.php +++ b/src/Schema/Concerns/HasMeta.php @@ -1,7 +1,7 @@ *