From 94fc176ae3110e537d2e718ada0858c0e5673694 Mon Sep 17 00:00:00 2001 From: ken lin Date: Thu, 16 Feb 2023 15:05:12 -0500 Subject: [PATCH] fixed type param --- src/Traits/Deletable.php | 2 +- src/Traits/NewResource.php | 6 ++++-- src/Traits/Pagination.php | 8 ++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Traits/Deletable.php b/src/Traits/Deletable.php index eb80430..8a55bdf 100644 --- a/src/Traits/Deletable.php +++ b/src/Traits/Deletable.php @@ -29,7 +29,7 @@ public function delete(string $primaryKey): void * * @param $id */ - public function confirmDeletion($id) + public function confirmDeletion($id): void { $this->itemKey = $id; diff --git a/src/Traits/NewResource.php b/src/Traits/NewResource.php index 3aa1e95..8bfd6ca 100644 --- a/src/Traits/NewResource.php +++ b/src/Traits/NewResource.php @@ -2,6 +2,8 @@ namespace Luckykenlin\LivewireTables\Traits; +use Illuminate\Http\RedirectResponse; + trait NewResource { /** @@ -10,11 +12,11 @@ trait NewResource public string $newResource = ''; /** - * @return \Illuminate\Http\RedirectResponse|void + * @return RedirectResponse|void */ public function resolveNewResource() { - if (! $this->hasNewResource()) { + if (!$this->hasNewResource()) { return; } diff --git a/src/Traits/Pagination.php b/src/Traits/Pagination.php index 125f2a0..95aa3e8 100644 --- a/src/Traits/Pagination.php +++ b/src/Traits/Pagination.php @@ -11,17 +11,17 @@ trait Pagination /** * Theme of pagination. */ - public $paginationTheme; + public string $paginationTheme; /** * Amount of items to show per page. */ - public $perPage; + public int $perPage; /** * The options to limit the amount of results per page. */ - public $perPageOptions; + public array $perPageOptions; /** * Show the per page select. @@ -47,7 +47,7 @@ trait Pagination /** * Initialize */ - protected function initializePagination() + protected function initializePagination(): void { $this->paginationTheme = $this->paginationTheme ?? config('livewire-tables.tailwind', 'tailwind');