Skip to content

Commit

Permalink
Use HtmlElement for creating html tags
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 1, 2023
1 parent 118d25a commit 1e28928
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/Common/BaseListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use ipl\Html\Attributes;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
use ipl\Html\HtmlElement;

/**
Expand Down Expand Up @@ -64,7 +63,7 @@ protected function assembleVisual(BaseHtmlElement $visual)

protected function createCaption(): BaseHtmlElement
{
$caption = Html::tag('section', ['class' => 'caption']);
$caption = new HtmlElement('section', Attributes::create(['class' => 'caption']));

$this->assembleCaption($caption);

Expand All @@ -73,7 +72,7 @@ protected function createCaption(): BaseHtmlElement

protected function createHeader(): BaseHtmlElement
{
$header = Html::tag('header');
$header = new HtmlElement('header');

$this->assembleHeader($header);

Expand All @@ -82,7 +81,7 @@ protected function createHeader(): BaseHtmlElement

protected function createMain(): BaseHtmlElement
{
$main = Html::tag('div', ['class' => 'main']);
$main = new HtmlElement('div', Attributes::create(['class' => 'main']));

$this->assembleMain($main);

Expand Down Expand Up @@ -122,7 +121,7 @@ protected function createTimestamp()

protected function createTitle(): BaseHtmlElement
{
$title = HTML::tag('div', ['class' => 'title']);
$title = new HtmlElement('div', Attributes::create(['class' => 'title']));

$this->assembleTitle($title);

Expand All @@ -134,7 +133,7 @@ protected function createTitle(): BaseHtmlElement
*/
protected function createVisual()
{
$visual = Html::tag('div', ['class' => 'visual']);
$visual = new HtmlElement('div', Attributes::create(['class' => 'visual']));

$this->assembleVisual($visual);

Expand Down
4 changes: 2 additions & 2 deletions src/Common/BaseStatusBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use ipl\Html\Attributes;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
use ipl\Html\HtmlElement;
use ipl\Stdlib\BaseFilter;

abstract class BaseStatusBar extends BaseHtmlElement
Expand All @@ -28,7 +28,7 @@ abstract protected function createStateBadges(): BaseHtmlElement;

protected function createCount(): BaseHtmlElement
{
$total = Html::tag('span', ['class' => 'item-count']);
$total = new HtmlElement('span', Attributes::create(['class' => 'item-count']));

$this->assembleTotal($total);

Expand Down

0 comments on commit 1e28928

Please sign in to comment.