Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Some named params, no real added value right now.
James Coleb5fdb3392184
diff --git a/app/Api/V1/Controllers/Controller.php b/app/Api/V1/Controllers/Controller.phpindex 85f914c444..cba640d9fa 100644--- a/app/Api/V1/Controllers/Controller.php+++ b/app/Api/V1/Controllers/Controller.php@@ -179,7 +179,7 @@ abstract class Controller extends BaseController{$bag = new ParameterBag();$page = (int) request()->get('page');- $page = clamp($page, 1, 2 ** 16);+ $page = clamp(value: $page, min:1, max:2 ** 16);$bag->set('page', $page);// some date fields:diff --git a/app/Api/V1/Requests/PaginationRequest.php b/app/Api/V1/Requests/PaginationRequest.phpindex 5e7681609c..0d8c467af2 100644--- a/app/Api/V1/Requests/PaginationRequest.php+++ b/app/Api/V1/Requests/PaginationRequest.php@@ -70,7 +70,7 @@ class PaginationRequest extends ApiRequest$limit = (int) Preferences::getForUser($user, 'listPageSize', 50)->data;}$page = $this->convertInteger('page');- $page = clamp($page, 1, 2 ** 16);+ $page = clamp(value: $page, min:1, max:2 ** 16);$offset = ($page - 1) * $limit;$sort = null !== $this->sortClass ? $this->convertSortParameters('sort', $this->sortClass) : $this->get('sort');$this->attributes->set('limit', $limit);diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.phpindex 6cfd5e026f..52e19fd2d7 100644--- a/app/Http/Controllers/SearchController.php+++ b/app/Http/Controllers/SearchController.php@@ -67,7 +67,7 @@ final class SearchController extends Controller}$fullQuery = (string) $fullQuery;$page = 0 === (int) $request->input('page') ? 1 : (int) $request->input('page');- $page = clamp($page, 1, 2 ** 16);+ $page = clamp(value: $page, min:1, max:2 ** 16);$ruleId = (int) $request->input('rule');$ruleChanged = false;@@ -117,7 +117,7 @@ final class SearchController extends Controller}$fullQuery = (string) $entry;$page = 0 === (int) $request->input('page') ? 1 : (int) $request->input('page');- $page = clamp($page, 1, 2 ** 16);+ $page = clamp(value: $page, min:1, max:2 ** 16);$searcher->parseQuery($fullQuery);diff --git a/app/Http/Controllers/TagController.php b/app/Http/Controllers/TagController.phpindex e43b8e9ff8..2c1ac4da68 100644--- a/app/Http/Controllers/TagController.php+++ b/app/Http/Controllers/TagController.php@@ -298,7 +298,7 @@ final class TagController extends Controller// default values:$subTitleIcon = 'bi-tag';$page = (int) $request->input('page');- $page = clamp($page, 1, 2 ** 16);+ $page = clamp(value: $page, min:1, max:2 ** 16);$pageSize = (int) Preferences::get('listPageSize', 50)->data;$periods = [];$subTitle = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);