From 2aca9a441ef48fb66ace8a5bfb9d8b730bc4e925 Mon Sep 17 00:00:00 2001 From: Sam Light Date: Tue, 23 Sep 2025 22:54:57 +0100 Subject: Initial pint code formatting --- src/Toolbar.php | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src/Toolbar.php') diff --git a/src/Toolbar.php b/src/Toolbar.php index 80f093b..0a8aaad 100644 --- a/src/Toolbar.php +++ b/src/Toolbar.php @@ -2,21 +2,21 @@ namespace Lightscale\LaralightTables; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Collection; +use Illuminate\View\View; +use Lightscale\LaralightTables\Concerns\Makable; +use Lightscale\LaralightTables\Toolbar\Filter as FilterItem; use Lightscale\LaralightTables\Toolbar\Item as ToolbarItem; -use Lightscale\LaralightTables\Toolbar\Search as SearchItem; use Lightscale\LaralightTables\Toolbar\PageSize as PageSizeItem; -use Lightscale\LaralightTables\Toolbar\Filter as FilterItem; -use Lightscale\LaralightTables\Concerns\Makable; - -use Illuminate\View\View; -use Illuminate\Support\Collection; -use Illuminate\Database\Eloquent\Model; +use Lightscale\LaralightTables\Toolbar\Search as SearchItem; class Toolbar { use Makable; protected ?SearchItem $searchItem = null; + protected ?PageSizeItem $pageSizeItem = null; /** @@ -41,12 +41,12 @@ class Toolbar /** * @template TModel of Model - * @param TableComponent $table + * + * @param TableComponent $table */ public function __construct( private TableComponent $table - ) - { + ) { $this->startItems = collect(); $this->midItems = collect(); $this->endItems = collect(); @@ -59,32 +59,32 @@ class Toolbar if ($item instanceof FilterItem) { $this->filterItems->push($item); - } - else if ($item instanceof PageSizeItem) { + } elseif ($item instanceof PageSizeItem) { $this->pageSizeItem = $item; - } - else if ($item instanceof SearchItem) { + } elseif ($item instanceof SearchItem) { $this->searchItem = $item; } } /** - * @param Collection $list + * @param Collection $list */ private function prependItem(Collection $list, ToolbarItem $item): static { $this->processItem($item); $list->prepend($item); + return $this; } /** - * @param Collection $list + * @param Collection $list */ private function appendItem(Collection $list, ToolbarItem $item): static { $this->processItem($item); $list->push($item); + return $this; } @@ -152,5 +152,4 @@ class Toolbar 'endItems' => $this->endItems, ]); } - } -- cgit v1.2.3