diff options
-rw-r--r-- | phpstan.neon | 4 | ||||
-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 |
5 files changed, 17 insertions, 4 deletions
diff --git a/phpstan.neon b/phpstan.neon index a0eca18..4cc4ec5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,8 +5,8 @@ includes: parameters: paths: - - src/ - workbench/app + - src/ # Level 10 is the highest level - level: 1 + level: 8 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(); } |