Skip to content

Commit

Permalink
Fix missing return type error
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 6, 2023
1 parent 431de8a commit 8247089
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
6 changes: 4 additions & 2 deletions src/Common/BaseItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,19 @@ public function hasIconImages(): bool
*
* @return $this
*/
public function setHasIconImages(bool $hasIconImages)
public function setHasIconImages(bool $hasIconImages): self
{
$this->hasIconImages = $hasIconImages;

return $this;
}

/**
* Initialize the item list
*
* If you want to adjust the item list after construction, override this method.
*/
protected function init()
protected function init(): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Common/BaseItemTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($data)
*
* If you want to adjust the item table after construction, override this method.
*/
protected function init()
protected function init(): void
{
}

Expand Down
21 changes: 11 additions & 10 deletions src/Common/BaseListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ public function __construct($item, BaseItemList $list)
$this->init();
}

abstract protected function assembleHeader(BaseHtmlElement $header);
abstract protected function assembleHeader(BaseHtmlElement $header): void;

abstract protected function assembleMain(BaseHtmlElement $main);
abstract protected function assembleMain(BaseHtmlElement $main): void;

protected function assembleFooter(BaseHtmlElement $footer)
protected function assembleFooter(BaseHtmlElement $footer): void
{
}

protected function assembleCaption(BaseHtmlElement $caption)
protected function assembleCaption(BaseHtmlElement $caption): void
{
}

protected function assembleIconImage(BaseHtmlElement $iconImage)
protected function assembleIconImage(BaseHtmlElement $iconImage): void
{
}

protected function assembleTitle(BaseHtmlElement $title)
protected function assembleTitle(BaseHtmlElement $title): void
{
}

protected function assembleVisual(BaseHtmlElement $visual)
protected function assembleVisual(BaseHtmlElement $visual): void
{
}

Expand Down Expand Up @@ -101,7 +101,7 @@ protected function createFooter(): BaseHtmlElement
/**
* @return ?BaseHtmlElement
*/
protected function createIconImage()
protected function createIconImage(): ?BaseHtmlElement
{
if (! $this->list->hasIconImages()) {
return null;
Expand All @@ -116,8 +116,9 @@ protected function createIconImage()
return $iconImage;
}

protected function createTimestamp()
protected function createTimestamp(): ?BaseHtmlElement
{
return null;
}

protected function createTitle(): BaseHtmlElement
Expand Down Expand Up @@ -146,7 +147,7 @@ protected function createVisual()
*
* If you want to adjust the list item after construction, override this method.
*/
protected function init()
protected function init(): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Common/BaseStatusBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(Model $summary)
$this->summary = $summary;
}

abstract protected function assembleTotal(BaseHtmlElement $total);
abstract protected function assembleTotal(BaseHtmlElement $total): void;

abstract protected function createStateBadges(): BaseHtmlElement;

Expand Down
8 changes: 4 additions & 4 deletions src/Common/BaseTableRowItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public function __construct($item, BaseItemTable $table = null)
$this->init();
}

abstract protected function assembleTitle(BaseHtmlElement $title);
abstract protected function assembleTitle(BaseHtmlElement $title): void;

protected function assembleColumns(HtmlDocument $columns)
protected function assembleColumns(HtmlDocument $columns): void
{
}

protected function assembleVisual(BaseHtmlElement $visual)
protected function assembleVisual(BaseHtmlElement $visual): void
{
}

Expand Down Expand Up @@ -108,7 +108,7 @@ protected function createVisual()
*
* If you want to adjust the list item after construction, override this method.
*/
protected function init()
protected function init(): void
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/Common/ListItemCommonLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ trait ListItemCommonLayout
{
use CaptionDisabled;

protected function assembleHeader(BaseHtmlElement $header)
protected function assembleHeader(BaseHtmlElement $header): void
{
$header->addHtml($this->createTitle());
$header->add($this->createTimestamp());
}

protected function assembleMain(BaseHtmlElement $main)
protected function assembleMain(BaseHtmlElement $main): void
{
$main->addHtml($this->createHeader());
if (! $this->isCaptionDisabled()) {
Expand Down

0 comments on commit 8247089

Please sign in to comment.