diff --git a/src/NotFound/Layout/Elements/LayoutBreadcrumb.php b/src/NotFound/Layout/Elements/LayoutBreadcrumb.php index 144172a..4c80a0c 100644 --- a/src/NotFound/Layout/Elements/LayoutBreadcrumb.php +++ b/src/NotFound/Layout/Elements/LayoutBreadcrumb.php @@ -21,7 +21,7 @@ public function __construct() * * @return void */ - public function addHome(string $title = null, string $link = '/'): self + public function addHome(?string $title = null, string $link = '/'): self { $this->properties->items[] = (object) ['title' => $title ?? 'Home', 'link' => $link]; @@ -31,11 +31,11 @@ public function addHome(string $title = null, string $link = '/'): self /** * Add an item to the breadcrumbs. * - * @param mixed $title Title displayed on the UI - * @param mixed $link Link (optional) Last item should always be the current path en should not link anywhere. + * @param mixed $title Title displayed on the UI + * @param mixed $link Link (optional) Last item should always be the current path en should not link anywhere. * @return void */ - public function addItem(string $title, string $link = null): self + public function addItem(string $title, ?string $link = null): self { $this->properties->items[] = (object) ['title' => $title, 'link' => $link]; diff --git a/src/NotFound/Layout/Elements/LayoutPager.php b/src/NotFound/Layout/Elements/LayoutPager.php index ee630eb..ba631bf 100644 --- a/src/NotFound/Layout/Elements/LayoutPager.php +++ b/src/NotFound/Layout/Elements/LayoutPager.php @@ -4,7 +4,7 @@ class LayoutPager extends AbstractLayout { - public function __construct(int $totalItems, int $itemsPerPage = null) + public function __construct(int $totalItems, ?int $itemsPerPage = null) { parent::__construct(type: 'Pager'); diff --git a/src/NotFound/Layout/Elements/Table/LayoutTable.php b/src/NotFound/Layout/Elements/Table/LayoutTable.php index aaba0f9..6e18016 100644 --- a/src/NotFound/Layout/Elements/Table/LayoutTable.php +++ b/src/NotFound/Layout/Elements/Table/LayoutTable.php @@ -14,11 +14,11 @@ class LayoutTable extends AbstractLayout /** * __construct * - * @param array $headers An array of LayoutTableHeader elements. - * @param array $rows An array of LayoutTableRow elements. - * @param bool $sort Will we be able to sort rows on the frontend. - * @param bool $delete Will we be able to delete rows on the frontend. - * @param bool $edit Will we be able to edit rows on the frontend. + * @param array $headers An array of LayoutTableHeader elements. + * @param array $rows An array of LayoutTableRow elements. + * @param bool $sort Will we be able to sort rows on the frontend. + * @param bool $delete Will we be able to delete rows on the frontend. + * @param bool $edit Will we be able to edit rows on the frontend. * @return void */ public function __construct(bool $sort = true, bool $delete = true, bool $edit = true, bool $create = true) @@ -51,7 +51,7 @@ public function addRow(LayoutTableRow $row): self /** * Used for pagination to display the number of pages in total * - * @param $number number of items + * @param $number number of items */ public function setTotalItems(int $number) { diff --git a/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php b/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php index 1cba73e..15de0cc 100644 --- a/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php +++ b/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php @@ -12,7 +12,7 @@ class LayoutTableColumn { public function __construct( - public string $value, + public string|bool $value, public string $type = 'text', public object $properties = new stdClass() ) { diff --git a/src/NotFound/Layout/Inputs/LayoutInputHidden.php b/src/NotFound/Layout/Inputs/LayoutInputHidden.php new file mode 100644 index 0000000..b39a3df --- /dev/null +++ b/src/NotFound/Layout/Inputs/LayoutInputHidden.php @@ -0,0 +1,10 @@ +actions = new Collection(); $this->elements = new Collection(); diff --git a/src/NotFound/Layout/Responses/Redirect.php b/src/NotFound/Layout/Responses/Redirect.php index 10f934e..a4ae689 100644 --- a/src/NotFound/Layout/Responses/Redirect.php +++ b/src/NotFound/Layout/Responses/Redirect.php @@ -12,7 +12,7 @@ class Redirect extends Action /** * __construct * - * @param mixed $target The path to navigate to (without locale!) + * @param mixed $target The path to navigate to (without locale!) * @return void */ public function __construct(string $target)