Skip to content

Commit df5379c

Browse files
Refactor AbstractBlockElement and Block classes to use HasTagName trait. (#4)
1 parent 0fd3b78 commit df5379c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
- Enh #1: Initial commit (@terabytesoftw)
66
- Bug #2: Update docs `Block.md` (@terabytesoftw)
77
- Enh #3: Update `ui-awesome/html-attribute`, `ui-awesome/html-concern`, `ui-awesome/html-helper` to `0.2` (@terabytesoftw)
8+
- Bug #4: Refactor `AbstractBlockElement` and `Block` classes to use `HasTagName` trait (@terabytesoftw)

src/Base/AbstractBlockElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
Attribute\HasTitle,
1515
Concern\HasAttributes,
1616
Concern\HasContent,
17-
Concern\HasTagName,
1817
Core\HTMLBuilder,
1918
Interop\RenderInterface
2019
};
@@ -31,9 +30,10 @@ abstract class AbstractBlockElement extends Block implements RenderInterface
3130
use HasId;
3231
use HasLang;
3332
use HasStyle;
34-
use HasTagName;
3533
use HasTitle;
3634

35+
protected string $tagName = '';
36+
3737
/**
3838
* Begin rendering the block element.
3939
*

src/Block.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace UIAwesome\Html\Core;
66

7+
use UIAwesome\Html\Concern\HasTagName;
8+
79
/**
810
* The `<block>` HTML element represents a generic block-level element.
911
*
@@ -23,4 +25,7 @@
2325
*
2426
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
2527
*/
26-
final class Block extends Base\AbstractBlockElement {}
28+
final class Block extends Base\AbstractBlockElement
29+
{
30+
use HasTagName;
31+
}

0 commit comments

Comments
 (0)