Skip to content

Commit

Permalink
Fix type hinting in method return types
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashammarstrand committed Feb 8, 2024
1 parent 36bf838 commit dc6705a
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/Traits/Helpers/ComponentHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,47 +85,47 @@ public function getComponentWrapperAttributes(): array
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getTableWrapperAttributes(): array
{
return count($this->tableWrapperAttributes) ? $this->tableWrapperAttributes : ['default' => true];
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getTableAttributes(): array
{
return count($this->tableAttributes) ? $this->tableAttributes : ['default' => true];
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getTheadAttributes(): array
{
return count($this->theadAttributes) ? $this->theadAttributes : ['default' => true];
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getTbodyAttributes(): array
{
return count($this->tbodyAttributes) ? $this->tbodyAttributes : ['default' => true];
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getThAttributes(Column $column): array
{
return $this->thAttributesCallback ? call_user_func($this->thAttributesCallback, $column) : ['default' => true];
}

/**
* @return array<mixed>
* @return array<mixed>
*/
public function getThSortButtonAttributes(Column $column): array
{
Expand Down
4 changes: 2 additions & 2 deletions src/Views/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Column

protected ?string $customSlug = null;

public function __construct(string $title, ?string $from = null)
public function __construct(string $title, string $from = null)
{
$this->title = trim($title);

Expand All @@ -101,7 +101,7 @@ public function __construct(string $title, ?string $from = null)
/**
* @return static
*/
public static function make(string $title, ?string $from = null): Column
public static function make(string $title, string $from = null): Column
{
return new static($title, $from);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/ButtonGroupColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ButtonGroupColumn extends Column

protected $attributesCallback;

public function __construct(string $title, ?string $from = null)
public function __construct(string $title, string $from = null)
{
parent::__construct($title, $from);

Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/ComponentColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ComponentColumn extends Column

protected $slotCallback;

public function __construct(string $title, ?string $from = null)
public function __construct(string $title, string $from = null)
{
parent::__construct($title, $from);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/ImageColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ImageColumn extends Column

protected $attributesCallback;

public function __construct(string $title, ?string $from = null)
public function __construct(string $title, string $from = null)
{
parent::__construct($title, $from);

Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/LinkColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LinkColumn extends Column

protected $attributesCallback;

public function __construct(string $title, ?string $from = null)
public function __construct(string $title, string $from = null)
{
parent::__construct($title, $from);

Expand Down
4 changes: 2 additions & 2 deletions src/Views/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class Filter

protected $filterDefaultValue;

public function __construct(string $name, ?string $key = null)
public function __construct(string $name, string $key = null)
{
$this->name = $name;

Expand All @@ -58,7 +58,7 @@ public function __construct(string $name, ?string $key = null)
/**
* @return static
*/
public static function make(string $name, ?string $key = null): Filter
public static function make(string $name, string $key = null): Filter
{
return new static($name, $key);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Views/Traits/Configuration/ColumnConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function label(callable $callback): self
return $this;
}

public function sortable(?callable $callback = null): self
public function sortable(callable $callback = null): self
{
$this->sortable = true;

Expand All @@ -39,7 +39,7 @@ public function format(callable $callable): Column
return $this;
}

public function searchable(?callable $callback = null): self
public function searchable(callable $callback = null): self
{
$this->searchable = true;

Expand Down

0 comments on commit dc6705a

Please sign in to comment.