Skip to content

Commit

Permalink
Use addHtml() instead of add()
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 1, 2023
1 parent 8d0102e commit 118d25a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Common/BaseItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ protected function assemble()
foreach ($this->data as $data) {
/** @var BaseListItem|BaseTableRowItem $item */
$item = new $itemClass($data, $this);
$this->add($item);
$this->addHtml($item);
}

if ($this->isEmpty()) {
$this->setTag('div');
$this->add(new EmptyState(t('No items found.')));
$this->addHtml(new EmptyState(t('No items found.')));
}
}
}
5 changes: 3 additions & 2 deletions src/Common/BaseItemTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,13 @@ protected function assemble()
foreach ($this->data as $data) {
/** @var BaseTableRowItem $item */
$item = new $itemClass($data, $this);
$this->add($item);

$this->addHtml($item);
}

if ($this->isEmpty()) {
$this->setTag('div');
$this->add(new EmptyState(t('No items found.')));
$this->addHtml(new EmptyState(t('No items found.')));
}
}
}
4 changes: 2 additions & 2 deletions src/Common/BaseOrderedItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ protected function assemble()
$item = new $itemClass($data, $this);
$item->setOrder($i++);

$this->add($item);
$this->addHtml($item);
}

if ($this->isEmpty()) {
$this->setTag('div');
$this->add(new EmptyState(t('No items found.')));
$this->addHtml(new EmptyState(t('No items found.')));
}
}
}
4 changes: 2 additions & 2 deletions src/Common/BaseStatusBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ protected function createCount(): BaseHtmlElement

protected function assemble()
{
$this->add([
$this->addHtml(
$this->createCount(),
$this->createStateBadges()
]);
);
}
}
4 changes: 2 additions & 2 deletions src/Common/BaseTableRowItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ protected function init()

protected function assemble()
{
$this->add([
$this->addHtml(
$this->createTitle(),
$this->createColumns()
]);
);
}
}
6 changes: 3 additions & 3 deletions src/Common/ListItemCommonLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ trait ListItemCommonLayout

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

protected function assembleMain(BaseHtmlElement $main)
{
$main->add($this->createHeader());
$main->addHtml($this->createHeader());
if (! $this->isCaptionDisabled()) {
$main->add($this->createCaption());
$main->addHtml($this->createCaption());
}
}
}
2 changes: 1 addition & 1 deletion src/Widget/ShowMore.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function renderUnwrapped(): string
protected function assemble()
{
if ($this->resultSet->hasMore()) {
$this->add(new ActionLink($this->getLabel(), $this->url));
$this->addHtml(new ActionLink($this->getLabel(), $this->url));
}
}
}

0 comments on commit 118d25a

Please sign in to comment.