Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Version 1.6.0 #6

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/NotFound/Layout/Elements/LayoutBreadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion src/NotFound/Layout/Elements/LayoutPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
12 changes: 6 additions & 6 deletions src/NotFound/Layout/Elements/Table/LayoutTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NotFound/Layout/Elements/Table/LayoutTableColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
) {
Expand Down
10 changes: 10 additions & 0 deletions src/NotFound/Layout/Inputs/LayoutInputHidden.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace NotFound\Layout\Inputs;

class LayoutInputHidden extends LayoutInputText
{
protected string $type = 'InputHidden';

protected string $value = '';
}
2 changes: 1 addition & 1 deletion src/NotFound/Layout/Inputs/LayoutInputTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LayoutInputTags extends AbstractInput
* Set the current value of the input select
* The value must be an array of identifiers, most likely ids
*
* @param int[] $value array of identifiers
* @param int[] $value array of identifiers
* @return void
*/
public function setValue(mixed $value): self
Expand Down
2 changes: 1 addition & 1 deletion src/NotFound/Layout/LayoutResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LayoutResponse

private ?string $nextRequest = null;

public function __construct(AbstractLayout $ui = null, Action $action = null)
public function __construct(?AbstractLayout $ui = null, ?Action $action = null)
{
$this->actions = new Collection();
$this->elements = new Collection();
Expand Down
2 changes: 1 addition & 1 deletion src/NotFound/Layout/Responses/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down