diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Columns/Column.php | 8 | ||||
-rw-r--r-- | src/Columns/ElementColumn.php | 4 | ||||
-rw-r--r-- | src/Columns/LinkColumn.php | 3 | ||||
-rw-r--r-- | src/TableComponent.php | 2 |
4 files changed, 15 insertions, 2 deletions
diff --git a/src/Columns/Column.php b/src/Columns/Column.php index ad3a787..e4c50a9 100644 --- a/src/Columns/Column.php +++ b/src/Columns/Column.php @@ -15,7 +15,6 @@ use Closure; class Column { use Makable; - /** * @var TableComponent<Model> */ @@ -23,8 +22,15 @@ class Column { private bool $showInSelect; private bool $shouldEscape = true; + /** + * @var ?Closure(Model, Column): string + */ private ?Closure $slotFn = null; private ?Closure $sortFn = null; + + /** + * @var ?Closure(Model): array<string, string> + */ private ?Closure $tdAttributesFn = null; private ?string $colClass = null; diff --git a/src/Columns/ElementColumn.php b/src/Columns/ElementColumn.php index 0e98d4a..0e78545 100644 --- a/src/Columns/ElementColumn.php +++ b/src/Columns/ElementColumn.php @@ -12,6 +12,10 @@ abstract class ElementColumn extends Column { protected string $element; + + /** + * @var ?Closure(Model): array<string, string> + */ private ?Closure $elemAttributesFn = null; public function attributes(callable $fn) : static diff --git a/src/Columns/LinkColumn.php b/src/Columns/LinkColumn.php index edb1140..5cc8407 100644 --- a/src/Columns/LinkColumn.php +++ b/src/Columns/LinkColumn.php @@ -10,6 +10,9 @@ class LinkColumn extends ElementColumn { protected string $element = 'a'; + /** + * @var Closure(Model): string + */ private Closure $urlFn; public function url(callable $fn) : static diff --git a/src/TableComponent.php b/src/TableComponent.php index affb8fd..e50fdb3 100644 --- a/src/TableComponent.php +++ b/src/TableComponent.php @@ -182,7 +182,7 @@ abstract class TableComponent extends Component protected function getFilters(): Collection { return $this->getToolbars() - ->map(fn(Toolbar $toolbar) => $toolbar->getFilters()) + ->map(fn(Toolbar $toolbar): Collection => $toolbar->getFilters()) ->flatten(); } |