Skip to content

fix(html): Update ui-awesome/html-helper to version ^0.7 and ui-awesome/html-mixin to version ^0.4 in composer.json and apply necessary changes to src and tests directories.#43

Merged
terabytesoftw merged 3 commits intomainfrom
fix_mini_7
Feb 15, 2026

Conversation

@terabytesoftw
Copy link
Contributor

Pull Request

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

terabytesoftw and others added 2 commits February 15, 2026 16:06
…awesome/html-mixin` to version `^0.4` in `composer.json` and apply necessary changes to `src` and `tests` directories.
@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Dependencies

    • Updated ui-awesome/html-helper to ^0.7
    • Updated ui-awesome/html-attribute to ^0.6@dev
    • Added ui-awesome/html-mixin ^0.4
  • Refactor

    • Refactored form input components (InputCheckbox, InputRadio)
    • Updated attribute handling mechanism across multiple HTML components
    • Enhanced form choice element structure
    • Updated comprehensive test coverage

Walkthrough

Refactors attribute API by replacing addAttribute() with setAttribute() across traits and tags, updates composer dependencies (adds ui-awesome/html-mixin; bumps helper/attribute versions), introduces BaseChoice and CanBeUnchecked for form choice inputs, and removes HasLabel while updating many tests to the new API.

Changes

Cohort / File(s) Summary
Composer
composer.json
Bumped ui-awesome/html-helper to ^0.7, updated ui-awesome/html-attribute to ^0.6@dev, and added ui-awesome/html-mixin ^0.4.
Form base & mixins
src/Form/Base/BaseChoice.php, src/Form/Mixin/CanBeUnchecked.php
Added BaseChoice abstract class and CanBeUnchecked trait to centralize choice input rendering and unchecked-value handling.
Form inputs
src/Form/InputCheckbox.php, src/Form/InputRadio.php
Both now extend BaseChoice; removed per-class label/unchecked/trait implementations and related properties.
Label/label handling
src/Form/Mixin/HasLabel.php, src/Phrasing/Label.php
Removed HasLabel trait; Label::_for() now uses setAttribute() instead of addAttribute().
Attribute traits (bulk)
src/.../Attribute/* (Embedded, Form, List, Metadata folders)*
Replaced internal addAttribute(...) calls with setAttribute(...) and updated docblocks from @method addAttribute to @mixin HasAttributes.
Tag API surface changes
src/... (various tag classes: Flow, Heading, List, Metadata, Root, Sectioning, Phrasing, Palpable, etc.)*
Renamed/added public fluent method setAttribute(...) replacing addAttribute(...) across many tag builder classes.
Tests
tests/**/*Test.php (50+ files)
Updated tests to use setAttribute() (and enum variants) instead of addAttribute(), added new setAttribute tests, and removed legacy addAttribute tests.
Changelog
CHANGELOG.md
Added entry documenting dependency bumps and attribute API changes.

*Files grouped by directory/pattern for brevity — many individual attribute trait files and tag classes were updated to use setAttribute() and corresponding docblock mixin annotations.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Test/Runtime
    participant BaseChoice as BaseChoice (render)
    participant Hidden as InputHidden
    participant Label as Label
    participant Html as Html\Builder

    Caller->>BaseChoice: render()/run()
    BaseChoice-->>Html: buildAttributes(parent::getAttributes())
    alt uncheckedValue set
        BaseChoice->>Hidden: create hidden input (same name, unchecked value)
        Hidden-->>BaseChoice: hidden HTML
    end
    alt label enabled
        BaseChoice->>Label: build label (enclosed or standalone)
        Label-->>BaseChoice: label HTML
    end
    BaseChoice->>Html: buildElement(prefix, tag, label, suffix)
    Html-->>Caller: final HTML output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 From add to set I hop and say,
I tuck the hidden value where it may,
BaseChoice builds labels, neat and bright,
Tests now set attributes just right,
A tiny rabbit cheers this refactor night.

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.97% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main changes: updating composer.json dependencies and applying necessary changes to src/tests directories.
Description check ✅ Passed The description is related to the changeset, clearly indicating this is a bugfix that updates dependencies without breaking BC.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_mini_7

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad1ad40 and 2de5528.

📒 Files selected for processing (57)
  • CHANGELOG.md
  • src/Form/InputRadio.php
  • tests/Embedded/ImgTest.php
  • tests/Flow/DivTest.php
  • tests/Flow/HrTest.php
  • tests/Flow/MainTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputSearchTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputWeekTest.php
  • tests/Heading/H1Test.php
  • tests/Heading/H2Test.php
  • tests/Heading/H3Test.php
  • tests/Heading/H4Test.php
  • tests/Heading/H5Test.php
  • tests/Heading/H6Test.php
  • tests/Heading/HGroupTest.php
  • tests/List/DdTest.php
  • tests/List/DlTest.php
  • tests/List/DtTest.php
  • tests/List/LiTest.php
  • tests/List/OlTest.php
  • tests/List/UlTest.php
  • tests/Metadata/BaseTest.php
  • tests/Metadata/LinkTest.php
  • tests/Metadata/MetaTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Metadata/StyleTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Metadata/TitleTest.php
  • tests/Palpable/ATest.php
  • tests/Phrasing/ITest.php
  • tests/Phrasing/LabelTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/BodyTest.php
  • tests/Root/FooterTest.php
  • tests/Root/HeadTest.php
  • tests/Root/HeaderTest.php
  • tests/Root/HtmlTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Sectioning/NavTest.php
  • tests/Sectioning/SectionTest.php
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:26.855Z
Learning: In the ui-awesome/html repository, short variable names (e.g., 2-character names like `$id`) are acceptable in test files and should not be flagged. PHPMD's short-variable rule does not need to be strictly followed in test code.
📚 Learning: 2026-02-06T21:37:44.509Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 24
File: tests/Form/InputTextTest.php:33-620
Timestamp: 2026-02-06T21:37:44.509Z
Learning: In the ui-awesome/html repository, prefer individual test methods over PHPUnit data providers in test classes. This helps maintainers see exactly how each test behaves without cross-referencing data providers. Apply to all PHP test files under tests. Use separate, descriptively named test methods to cover different inputs/edge cases; retain data providers only if they clearly improve readability or reduce duplication.

Applied to files:

  • tests/Form/InputCheckboxTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Heading/H4Test.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputWeekTest.php
  • tests/Root/BodyTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputRadioTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Flow/DivTest.php
  • tests/List/UlTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Form/InputResetTest.php
  • tests/Heading/H2Test.php
  • tests/Form/InputTelTest.php
  • tests/Metadata/LinkTest.php
  • tests/Metadata/BaseTest.php
  • tests/Sectioning/NavTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputSubmitTest.php
  • tests/List/LiTest.php
  • tests/Phrasing/ITest.php
  • tests/List/DlTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Flow/HrTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputNumberTest.php
  • tests/Root/HeaderTest.php
  • tests/Heading/H5Test.php
  • tests/Phrasing/LabelTest.php
  • tests/Heading/H1Test.php
  • tests/Root/HeadTest.php
  • tests/Palpable/ATest.php
  • tests/Form/InputSearchTest.php
  • tests/Metadata/MetaTest.php
  • tests/List/DtTest.php
  • tests/Form/InputRangeTest.php
  • tests/Flow/MainTest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/StyleTest.php
  • tests/Heading/HGroupTest.php
  • tests/List/DdTest.php
  • tests/Form/InputTimeTest.php
  • tests/Root/FooterTest.php
  • tests/Form/InputImageTest.php
  • tests/Root/HtmlTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputTextTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Heading/H6Test.php
  • tests/Metadata/TitleTest.php
  • tests/List/OlTest.php
📚 Learning: 2026-02-11T14:56:18.277Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:18.277Z
Learning: In PHP test files under the repository ui-awesome/html (e.g., tests/Form/InputTextTest.php), it is acceptable to use short variable names (e.g., 2-character names like $id). PHPMD's short-variable rule does not need to be strictly followed in test code. During reviews, allow short names in test files and note that this relaxed style applies to tests, while production code should adhere to the standard variable naming conventions.

Applied to files:

  • tests/Form/InputCheckboxTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Heading/H4Test.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputWeekTest.php
  • tests/Root/BodyTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputRadioTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Flow/DivTest.php
  • tests/List/UlTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Form/InputResetTest.php
  • tests/Heading/H2Test.php
  • tests/Form/InputTelTest.php
  • tests/Metadata/LinkTest.php
  • tests/Metadata/BaseTest.php
  • tests/Sectioning/NavTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputSubmitTest.php
  • tests/List/LiTest.php
  • tests/Phrasing/ITest.php
  • tests/List/DlTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Flow/HrTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputNumberTest.php
  • tests/Root/HeaderTest.php
  • tests/Heading/H5Test.php
  • tests/Phrasing/LabelTest.php
  • tests/Heading/H1Test.php
  • tests/Root/HeadTest.php
  • tests/Palpable/ATest.php
  • tests/Form/InputSearchTest.php
  • tests/Metadata/MetaTest.php
  • tests/List/DtTest.php
  • tests/Form/InputRangeTest.php
  • tests/Flow/MainTest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/StyleTest.php
  • tests/Heading/HGroupTest.php
  • tests/List/DdTest.php
  • tests/Form/InputTimeTest.php
  • tests/Root/FooterTest.php
  • tests/Form/InputImageTest.php
  • tests/Root/HtmlTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputTextTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Heading/H6Test.php
  • tests/Metadata/TitleTest.php
  • tests/List/OlTest.php
📚 Learning: 2026-02-09T11:28:09.334Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 35
File: tests/Provider/Form/CheckedProvider.php:13-14
Timestamp: 2026-02-09T11:28:09.334Z
Learning: In the ui-awesome/html repository, using `str_replace` to adapt shared data provider HTML strings for different input types (e.g., adapting `CheckedProvider` for both `InputCheckboxTest` and `InputRadioTest` by replacing "inputcheckbox-" with "inputradio-" and "checkbox" with "radio") is acceptable and considered clear. Don't suggest refactoring such patterns to avoid string replacement.

Applied to files:

  • src/Form/InputRadio.php
  • tests/Form/InputRadioTest.php
📚 Learning: 2026-02-06T21:37:51.711Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 24
File: tests/Form/InputTextTest.php:33-620
Timestamp: 2026-02-06T21:37:51.711Z
Learning: In the ui-awesome/html repository, prefer individual test methods over PHPUnit data providers in test classes. The maintainer values the ability to see exactly how each test works without needing to cross-reference data providers, even if it results in more methods.

Applied to files:

  • CHANGELOG.md
🧬 Code graph analysis (30)
tests/Form/InputCheckboxTest.php (5)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/Form/InputTelTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Form/InputUrlTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
src/Form/InputCheckbox.php (1)
  • InputCheckbox (31-57)
src/Form/InputRadio.php (1)
src/Form/Base/BaseChoice.php (1)
  • BaseChoice (19-115)
tests/Heading/H4Test.php (5)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H2Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H3Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Form/InputMonthTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
src/Form/InputMonth.php (1)
  • InputMonth (52-97)
tests/Root/BodyTest.php (5)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Root/Body.php (1)
  • Body (27-40)
tests/Form/InputRadioTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/Form/InputUrlTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
src/Form/InputRadio.php (1)
  • InputRadio (31-57)
tests/Phrasing/SpanTest.php (5)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/DivTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Phrasing/ITest.php (2)
  • testRenderWithSetAttribute (413-424)
  • testRenderWithSetAttributeUsingEnum (426-437)
src/Phrasing/Span.php (1)
  • Span (27-50)
tests/Form/InputResetTest.php (12)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputCheckboxTest.php (2)
  • testRenderWithSetAttribute (952-964)
  • testRenderWithSetAttributeUsingEnum (966-978)
tests/Form/InputNumberTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Form/InputPasswordTest.php (2)
  • testRenderWithSetAttribute (766-778)
  • testRenderWithSetAttributeUsingEnum (780-792)
tests/Form/InputRadioTest.php (2)
  • testRenderWithSetAttribute (961-973)
  • testRenderWithSetAttributeUsingEnum (975-987)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/Form/InputSubmitTest.php (2)
  • testRenderWithSetAttribute (713-725)
  • testRenderWithSetAttributeUsingEnum (727-739)
tests/Form/InputTelTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Form/InputTextTest.php (2)
  • testRenderWithSetAttribute (756-768)
  • testRenderWithSetAttributeUsingEnum (770-782)
tests/Form/InputTimeTest.php (2)
  • testRenderWithSetAttribute (728-740)
  • testRenderWithSetAttributeUsingEnum (742-754)
tests/Form/InputUrlTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Form/InputWeekTest.php (2)
  • testRenderWithSetAttribute (727-739)
  • testRenderWithSetAttributeUsingEnum (741-753)
tests/Heading/H2Test.php (3)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Heading/H2.php (1)
  • H2 (27-40)
tests/Metadata/BaseTest.php (7)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DdTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DlTest.php (2)
  • testRenderWithSetAttribute (595-607)
  • testRenderWithSetAttributeUsingEnum (609-621)
src/Metadata/Base.php (1)
  • Base (29-45)
tests/Form/InputSubmitTest.php (2)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/List/LiTest.php (6)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DdTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/List/Li.php (1)
  • Li (28-43)
tests/Phrasing/ITest.php (2)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
src/Phrasing/I.php (1)
  • I (27-50)
tests/Form/InputPasswordTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
src/Form/InputPassword.php (1)
  • InputPassword (44-91)
tests/Sectioning/ArticleTest.php (8)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H2Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H3Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H4Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Sectioning/Article.php (1)
  • Article (27-40)
tests/Form/InputNumberTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/Form/InputUrlTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Phrasing/LabelTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Phrasing/Label.php (1)
  • Label (27-68)
tests/Heading/H1Test.php (3)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Heading/H2Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Heading/H1.php (1)
  • H1 (27-40)
tests/Root/HeadTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
src/Root/Head.php (1)
  • Head (26-39)
tests/Form/InputSearchTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputTelTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/Form/InputTextTest.php (2)
  • testRenderWithSetAttribute (756-768)
  • testRenderWithSetAttributeUsingEnum (770-782)
tests/Form/InputUrlTest.php (2)
  • testRenderWithSetAttribute (743-755)
  • testRenderWithSetAttributeUsingEnum (757-769)
tests/List/DtTest.php (13)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/DivTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H2Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H3Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DdTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DlTest.php (2)
  • testRenderWithSetAttribute (595-607)
  • testRenderWithSetAttributeUsingEnum (609-621)
tests/List/LiTest.php (2)
  • testRenderWithSetAttribute (548-560)
  • testRenderWithSetAttributeUsingEnum (562-574)
tests/List/OlTest.php (2)
  • testRenderWithSetAttribute (614-626)
  • testRenderWithSetAttributeUsingEnum (628-640)
tests/List/UlTest.php (2)
  • testRenderWithSetAttribute (593-605)
  • testRenderWithSetAttributeUsingEnum (607-619)
src/List/Dt.php (1)
  • Dt (26-39)
tests/Heading/H3Test.php (3)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Heading/H3.php (1)
  • H3 (27-40)
tests/Heading/HGroupTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Heading/HGroup.php (1)
  • HGroup (29-42)
tests/Form/InputTimeTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
src/Form/InputTime.php (1)
  • InputTime (51-96)
tests/Root/FooterTest.php (6)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Phrasing/ITest.php (2)
  • testRenderWithSetAttribute (413-424)
  • testRenderWithSetAttributeUsingEnum (426-437)
src/Root/Footer.php (1)
  • Footer (27-40)
tests/Root/HtmlTest.php (4)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
src/Root/Html.php (1)
  • Html (27-40)
tests/Form/InputHiddenTest.php (3)
tests/Form/InputSearchTest.php (2)
  • testRenderWithSetAttribute (667-679)
  • testRenderWithSetAttributeUsingEnum (681-690)
tests/Form/InputTextTest.php (2)
  • testRenderWithSetAttribute (756-768)
  • testRenderWithSetAttributeUsingEnum (770-782)
src/Form/InputHidden.php (1)
  • InputHidden (31-68)
tests/Metadata/NoScriptTest.php (2)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
src/Metadata/NoScript.php (1)
  • NoScript (26-39)
tests/Embedded/ImgTest.php (5)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
tests/Flow/PTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H1Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Heading/H2Test.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/List/DdTest.php (2)
  • testRenderWithSetAttribute (532-544)
  • testRenderWithSetAttributeUsingEnum (546-558)
tests/Sectioning/AsideTest.php (3)
tests/Embedded/ImgTest.php (2)
  • testRenderWithSetAttribute (581-592)
  • testRenderWithSetAttributeUsingEnum (594-605)
tests/Flow/HrTest.php (2)
  • testRenderWithSetAttribute (374-385)
  • testRenderWithSetAttributeUsingEnum (387-398)
src/Sectioning/Aside.php (1)
  • Aside (27-40)
🔇 Additional comments (108)
tests/Heading/H4Test.php (1)

64-64: LGTM — consistent addAttributesetAttribute rename.

All three changed segments (Lines 64, 482, and 532–558) align with the same mechanical rename applied across sibling test files (H1Test, H2Test, H3Test, HrTest, ImgTest). The two new test methods follow the established pattern exactly.

Also applies to: 482-482, 532-558

tests/List/DdTest.php (3)

59-68: LGTM!

The addAttributesetAttribute rename in testGetAttributesReturnsAssignedAttributes is consistent with the broader API refactor.


474-487: LGTM!

Same consistent rename applied in testRenderWithRemoveAttribute.


532-558: LGTM!

Both new tests (testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum) follow the established patterns — individual descriptive test methods, consistent assertion messages, and proper use of the GlobalAttribute enum for the enum variant.

tests/Heading/HGroupTest.php (3)

59-68: LGTM!

The migration from addAttribute() to setAttribute() in testGetAttributesReturnsAssignedAttributes is consistent with the broader API change across the codebase.


474-487: LGTM!

Same addAttributesetAttribute migration applied correctly in the remove-attribute test flow.


532-558: LGTM!

The two new tests (testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum) follow the established patterns seen in H1Test, HrTest, and ImgTest. Expected HTML output and assertion messages are consistent.

tests/Form/InputTimeTest.php (2)

656-669: LGTM!

The migration from addAttribute() to setAttribute() in the remove-attribute test is consistent with the broader API change across the codebase.


728-754: LGTM!

Both new setAttribute tests are well-structured, follow the established patterns from other test files (e.g., ImgTest, InputSearchTest), and cover both string-key and enum-based attribute setting.

tests/Embedded/ImgTest.php (2)

581-605: New setAttribute tests are consistent with the codebase pattern.

These two new tests (testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum) exactly mirror the equivalent tests in HrTest, PTest, H1Test, H2Test, DdTest, etc. The structure, assertions, and failure messages are all aligned with the broader addAttributesetAttribute refactor.


63-63: setAttribute replacements in existing tests look correct.

Both call sites (Lines 63 and 534) correctly swap addAttribute for setAttribute, consistent with the API rename applied across the codebase.

Also applies to: 534-534

tests/Form/InputUrlTest.php (2)

671-684: LGTM — correctly migrated from addAttribute() to setAttribute().

The testRenderWithRemoveAttribute test properly uses the renamed API while preserving the original test intent (set then remove an attribute).


743-769: LGTM — new setAttribute() tests are well-structured.

Both string-key and enum-key variants follow the established test patterns in this file and provide clear coverage for the renamed API.

tests/List/OlTest.php (3)

60-69: LGTM!

Consistent migration from addAttribute() to setAttribute(). The test logic and assertion remain correct.


538-551: LGTM!

Same addAttribute()setAttribute() migration; the remove-then-verify flow is correct.


614-640: LGTM!

Good coverage for the new setAttribute() API — both the plain string key and enum-backed GlobalAttribute::TITLE variants are tested with correct expected output.

tests/Form/InputResetTest.php (2)

543-556: LGTM!

The migration from addAttribute() to setAttribute() in the remove-attribute test is correct and consistent with the API change.


601-627: LGTM!

Both new setAttribute() tests are consistent with the established pattern across other input test files (e.g., InputSubmitTest, InputSearchTest) and correctly cover string-keyed and enum-backed attribute scenarios.

tests/Sectioning/NavTest.php (2)

532-558: New setAttribute() tests are well-structured and consistent with the API migration.

Both testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum correctly exercise the renamed API with string and enum-backed keys respectively. Method names, assertions, and error messages all align with the setAttribute() convention.


64-64: Inline setAttribute() replacements are correct.

The call-site updates from addAttribute() to setAttribute() in testGetAttributesReturnsAssignedAttributes (Line 64) and testRenderWithRemoveAttribute (Line 482) are consistent with the broader API migration.

Also applies to: 482-482

tests/Heading/H3Test.php (3)

59-68: LGTM!

The addAttributesetAttribute migration in testGetAttributesReturnsAssignedAttributes is consistent with the project-wide API change.


474-487: LGTM!

Correctly updated to use setAttribute before testing removeAttribute, maintaining the intended test flow.


532-558: LGTM!

Both new setAttribute tests are consistent with the equivalent tests in H1Test and HrTest, correctly verifying string-key and enum-key attribute rendering for H3.

tests/Form/InputSearchTest.php (2)

604-617: LGTM!

The migration from addAttribute() to setAttribute() in the testRenderWithRemoveAttribute test is consistent with the broader API change and correctly validates the set-then-remove flow.


667-690: LGTM!

Both new tests are well-structured, consistent with the equivalent tests in InputTextTest, InputTelTest, and InputUrlTest, and properly cover the setAttribute() API with both string keys and enum-backed keys.

tests/Phrasing/SpanTest.php (3)

57-66: LGTM!

The migration from addAttribute() to setAttribute() is consistent with the broader API change across the codebase.


357-369: LGTM!

Correctly uses setAttribute() before removeAttribute() to validate the removal flow.


411-435: LGTM!

Both new tests follow the established pattern from other test files (DivTest, HrTest, ITest, ImgTest) and provide coverage for both string and enum-backed attribute keys with setAttribute().

tests/Heading/H6Test.php (3)

59-68: LGTM!

The migration from addAttribute() to setAttribute() is correctly applied here, and the test assertion remains valid.


474-487: LGTM!

Consistent use of setAttribute() before removeAttribute() — the test correctly verifies the remove path with the new API.


532-558: LGTM!

Both new tests provide solid coverage for the setAttribute() API — one with a plain string key, and one with an enum-backed key (GlobalAttribute::TITLE). They follow the established test patterns in this file.

tests/Sectioning/ArticleTest.php (3)

59-68: LGTM!

The addAttribute()setAttribute() migration in testGetAttributesReturnsAssignedAttributes is correct and consistent with the API rename across the repository.


474-487: LGTM!

The setAttribute() call properly replaces addAttribute() in the remove-attribute test flow. Test logic remains sound — set, remove, assert empty output.


532-558: LGTM!

Both new test methods follow the established pattern used consistently across HrTest, ImgTest, PTest, H1Test, etc. They cover the two setAttribute() call styles (string key and enum-backed key) with clear assertions and descriptive failure messages.

CHANGELOG.md (1)

31-31: LGTM!

Changelog entry is consistent with the existing format and accurately documents the dependency updates and codebase changes.

tests/Flow/HrTest.php (1)

374-398: LGTM!

New setAttribute() tests are consistent with the pattern used across other test files (e.g., ImgTest, PTest, H1Test). String-key and enum-key variants are both covered.

tests/Metadata/BaseTest.php (1)

407-431: LGTM!

The new setAttribute() tests follow the established pattern. The contextual value 'Base URL' in the enum variant is a nice touch for readability.

tests/Metadata/TemplateTest.php (1)

551-577: LGTM!

New setAttribute() tests are correctly structured for a block element (includes closing </template> tag) and follow the established pattern.

tests/Metadata/LinkTest.php (1)

620-644: LGTM!

New setAttribute() tests are correct for the void <link> element and use a contextually appropriate value.

tests/Sectioning/SectionTest.php (1)

532-558: LGTM!

Consistent with the project-wide setAttribute() migration pattern. Block element output correctly includes closing </section> tag.

tests/Root/HeadTest.php (1)

532-558: LGTM!

Consistent with the project-wide setAttribute() migration. Tests correctly cover string-key and enum-key variants for the <head> block element.

src/Form/InputRadio.php (1)

50-56: The template string is processed by the buildElement() method from the external ui-awesome/html-core package, which interprets \n as newlines in the template output, not as literal characters. The test suite confirms this—both InputRadioTest and InputCheckboxTest show actual line breaks in the rendered HTML (e.g., testRenderWithEnclosedByLabel). The single-quoted template string with \n is intentional and works correctly. No change needed.

tests/Form/InputHiddenTest.php (2)

628-654: LGTM — new setAttribute() tests are consistent with the codebase-wide pattern.

Both testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum follow the established pattern seen in sibling test files (e.g., InputSearchTest, InputTextTest). Expected HTML output correctly includes id="inputhidden" and type="hidden".


578-578: LGTM — removeAttribute flow correctly updated to use setAttribute().

tests/Phrasing/LabelTest.php (1)

62-62: LGTM — all setAttribute() migrations and new tests are correct and consistent.

The getAttributes, removeAttribute, and new setAttribute / setAttribute with enum tests all follow the established pattern. Expected HTML output is correct for the <label> element.

Also applies to: 379-379, 426-450

tests/Phrasing/ITest.php (1)

62-62: LGTM — consistent setAttribute() migration for the <i> element tests.

Also applies to: 366-366, 413-437

tests/Root/HtmlTest.php (1)

64-64: LGTM — setAttribute() changes for <html> root element tests are correct.

Block element HTML expectations correctly include the newline formatting between opening and closing tags.

Also applies to: 482-482, 532-558

tests/Metadata/NoScriptTest.php (1)

64-64: LGTM — setAttribute() migration for <noscript> tests follows the established pattern.

Also applies to: 493-493, 543-569

tests/Heading/H2Test.php (1)

64-64: LGTM — setAttribute() changes for <h2> are consistent with H1Test and other heading tests.

Also applies to: 482-482, 532-558

tests/Form/InputTextTest.php (1)

691-691: LGTM — setAttribute() changes and new tests for InputText are correct.

Also applies to: 756-782

tests/Form/InputMonthTest.php (1)

663-663: LGTM — setAttribute() migration and new tests for InputMonth are correct and consistent.

Also applies to: 728-754

tests/Form/InputWeekTest.php (2)

660-665: setAttribute migration in remove-attribute test looks consistent.


727-753: New setAttribute coverage (string + enum) is consistent with suite-wide API migration.

tests/List/LiTest.php (3)

60-66: Attribute assignment swap to setAttribute is aligned with the new API.


490-500: Remove-attribute path updated correctly to use setAttribute.


548-573: Added setAttribute tests (string + enum) match patterns in other list tests.

tests/List/DtTest.php (3)

59-65: getAttributes test now exercises setAttribute as intended.


474-483: removeAttribute test updated to setAttribute correctly.


532-557: New setAttribute coverage mirrors other list element tests.

tests/Metadata/MetaTest.php (3)

52-58: Meta getAttributes now validates the setAttribute path.


420-428: removeAttribute flow updated consistently to setAttribute.


472-496: New setAttribute tests (string + enum) are consistent with the migration.

tests/Form/InputCheckboxTest.php (3)

709-721: Label class expectation update matches new label attribute behavior.


880-889: removeAttribute path updated to setAttribute correctly.


952-977: New setAttribute tests (string + enum) align with other Input tests.*

tests/Flow/MainTest.php (3)

59-65: getAttributes test updated to setAttribute as expected.


474-483: removeAttribute now correctly follows setAttribute usage.


532-557: New setAttribute tests (string + enum) are consistent with other flow elements.

tests/Form/InputRangeTest.php (2)

642-651: removeAttribute test updated to setAttribute correctly.


700-725: Added setAttribute tests (string + enum) match other Input suites.*

tests/Heading/H1Test.php (3)

59-65: getAttributes now tests setAttribute as intended.


474-483: removeAttribute path updated consistently to setAttribute.


532-557: New setAttribute tests (string + enum) are aligned with other heading tests.

tests/Metadata/ScriptTest.php (2)

722-748: LGTM — new setAttribute() tests are consistent with the codebase-wide pattern.

The new testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum tests follow the same structure seen in other test files (e.g., HrTest, ImgTest, H1Test), covering both plain string keys and enum-backed keys via GlobalAttribute::TITLE.


74-74: LGTM — existing tests correctly updated from addAttribute() to setAttribute().

Also applies to: 672-672

tests/Form/InputImageTest.php (2)

700-726: LGTM — new setAttribute() tests follow the established pattern for form input test files.

Consistent with InputSearchTest and InputUrlTest patterns from the relevant code snippets.


649-649: LGTM — removeAttribute test correctly chains from setAttribute().

tests/Metadata/TitleTest.php (1)

64-64: LGTM — all setAttribute() changes are consistent with the API migration.

Also applies to: 494-494, 544-570

tests/Root/BodyTest.php (1)

64-64: LGTM — setAttribute() migration is consistent with the rest of the codebase.

Also applies to: 482-482, 532-558

tests/Sectioning/AsideTest.php (1)

64-64: LGTM — changes mirror the same pattern applied across all other element test files.

Also applies to: 482-482, 532-558

tests/Form/InputNumberTest.php (1)

678-678: LGTM — setAttribute() adoption is consistent with other form input tests.

Also applies to: 743-769

tests/Flow/PTest.php (1)

64-64: LGTM — consistent with the setAttribute() migration across the codebase.

Also applies to: 482-482, 532-558

tests/Heading/H5Test.php (1)

64-64: LGTM — identical pattern to H1Test and other heading test files.

Also applies to: 480-480, 530-556

tests/List/DlTest.php (3)

61-66: setAttribute usage matches the updated attribute API.


542-548: Remove-attribute flow correctly seeds with setAttribute.


595-621: New setAttribute coverage is clear and consistent.

tests/Root/FooterTest.php (3)

61-66: setAttribute change is consistent with the new API.


481-485: Attribute removal test correctly uses setAttribute first.


532-558: New setAttribute tests look solid.

tests/Root/HeaderTest.php (3)

61-66: Updated attribute assignment uses setAttribute as intended.


481-485: Remove-attribute test now aligns with the new API.


532-558: Added setAttribute tests provide the right coverage.

tests/Flow/DivTest.php (3)

61-66: setAttribute migration here looks correct.


481-485: Remove-attribute setup correctly switched to setAttribute.


532-558: setAttribute tests are consistent with other suites.

tests/List/UlTest.php (3)

61-66: setAttribute usage in getAttributes test is correct.


542-546: Remove-attribute test now uses setAttribute properly.


593-619: New setAttribute coverage looks good.

tests/Form/InputPasswordTest.php (2)

698-704: Remove-attribute path correctly seeds with setAttribute.


766-792: Added setAttribute tests are consistent with the suite.

tests/Form/InputSubmitTest.php (2)

658-665: Remove-attribute test now uses setAttribute appropriately.


713-739: New setAttribute tests are aligned with the updated API.

tests/Form/InputRadioTest.php (3)

718-731: Label class expectation reflects the updated label behavior.


895-901: Remove-attribute test correctly uses setAttribute first.


961-987: setAttribute coverage is clear and consistent.

tests/Palpable/ATest.php (1)

551-575: LGTM — new setAttribute() tests are consistent with the API migration.

The new testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum methods correctly mirror the removed addAttribute tests, and the updated calls in testGetAttributesReturnsAssignedAttributes (Line 70) and testRenderWithRemoveAttribute (Line 504) are consistent.

tests/Metadata/StyleTest.php (1)

606-632: LGTM — setAttribute() test additions and migration are consistent.

The new test methods and updated call sites (Lines 70, 556) correctly reflect the API rename from addAttribute to setAttribute.

tests/Form/InputTelTest.php (1)

743-769: LGTM — setAttribute() tests are well-structured and consistent with the rest of the suite.

The new methods and the updated testRenderWithRemoveAttribute (Line 678) align with the API migration across the codebase.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (139a567) to head (2de5528).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #43   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
+ Complexity       154       140   -14     
===========================================
  Files             75        76    +1     
  Lines            384       326   -58     
===========================================
- Hits             384       326   -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@terabytesoftw
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai bot added the bug Something isn't working label Feb 15, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (19)
tests/Heading/HGroupTest.php (1)

127-138: 🧹 Nitpick | 🔵 Trivial

Test method name is now misleading after the API rename.

testRenderWithAddAttribute still references the old addAttribute name but the body now calls setAttribute(). Consider renaming the method to testRenderWithSetAttribute so the test name matches the exercised API.

Same applies to testRenderWithAddAttributeUsingEnum on line 141.

Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
tests/Palpable/ATest.php (1)

128-152: 🧹 Nitpick | 🔵 Trivial

Test method names still reference addAttribute after the API rename.

testRenderWithAddAttribute (Line 128) and testRenderWithAddAttributeUsingEnum (Line 141) now call setAttribute(), but the method names still say "Add". Consider renaming to testRenderWithSetAttribute and testRenderWithSetAttributeUsingEnum for consistency with the updated API and assertion messages.

This same naming inconsistency applies across all test files in this PR.

tests/Form/InputWeekTest.php (1)

184-209: 🧹 Nitpick | 🔵 Trivial

Test method names still reference addAttribute while the body uses setAttribute.

testRenderWithAddAttribute and testRenderWithAddAttributeUsingEnum still carry "Add" in their names even though the underlying API is now setAttribute(). This inconsistency is repeated across all test files in this PR. Consider renaming them (e.g., testRenderWithSetAttribute, testRenderWithSetAttributeUsingEnum) so the method name matches the API being tested.

✏️ Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
     {
         // ...
     }

-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
     {
         // ...
     }
tests/Form/InputImageTest.php (1)

788-793: ⚠️ Potential issue | 🟡 Minor

Minor typo: "Select a image" → "Select an image".

The title attribute value and assertion message use "a image" instead of "an image".

✏️ Suggested fix
-            <input id="inputimage" type="image" title="Select a image">
+            <input id="inputimage" type="image" title="Select an image">
             HTML,
             InputImage::tag()
                 ->id('inputimage')
-                ->title('Select a image')
+                ->title('Select an image')
                 ->render(),
-            "Failed asserting that element renders correctly with 'title' attribute.",
+            "Failed asserting that element renders correctly with 'title' attribute.",
tests/Form/InputRangeTest.php (1)

183-208: 🧹 Nitpick | 🔵 Trivial

Test method names still reference addAttribute after the API rename.

testRenderWithAddAttribute (Line 183) and testRenderWithAddAttributeUsingEnum (Line 197) still use the old AddAttribute naming, but the body and assertion messages now reference setAttribute(). Consider renaming for consistency:

Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
tests/Form/InputUrlTest.php (1)

185-209: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency as other test files.

testRenderWithAddAttribute and testRenderWithAddAttributeUsingEnum should be renamed to testRenderWithSetAttribute / testRenderWithSetAttributeUsingEnum to match the updated setAttribute() API calls and assertion messages.

tests/Root/HeadTest.php (1)

127-152: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency.

testRenderWithAddAttribute (Line 127) and testRenderWithAddAttributeUsingEnum (Line 141) should be renamed to reflect the setAttribute() API, consistent with the updated assertion messages.

tests/Form/InputMonthTest.php (1)

183-208: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency as other files — testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum.

tests/Form/InputTextTest.php (1)

184-208: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency as other files — testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum.

tests/Form/InputHiddenTest.php (1)

182-208: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency as other files — testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum.

tests/Metadata/StyleTest.php (1)

133-158: 🧹 Nitpick | 🔵 Trivial

Test method names still reference addAttribute but now exercise setAttribute.

testRenderWithAddAttribute (Line 133) and testRenderWithAddAttributeUsingEnum (Line 147) still carry the old AddAttribute naming while the code and messages now reference setAttribute(). Consider renaming them to testRenderWithSetAttribute / testRenderWithSetAttributeUsingEnum for consistency. This same pattern applies across all the other test files in this PR.

tests/Heading/H5Test.php (1)

127-153: 🧹 Nitpick | 🔵 Trivial

Test method names still reference addAttribute after the API rename to setAttribute.

testRenderWithAddAttribute (Line 127) and testRenderWithAddAttributeUsingEnum (Line 141) now test setAttribute(), but the method names still say "AddAttribute". The assertion messages were updated, but the method names were not. This same inconsistency appears across all test files in this PR.

Consider renaming for consistency:

Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
tests/Flow/DivTest.php (1)

127-153: 🧹 Nitpick | 🔵 Trivial

Test method names still reference AddAttribute while the body now calls setAttribute.

Methods testRenderWithAddAttribute (Line 127) and testRenderWithAddAttributeUsingEnum (Line 141) were updated to call setAttribute() with matching assertion messages, but the method names themselves were not renamed. This applies consistently across all test files in this PR (DivTest, OlTest, DlTest, AsideTest, SectionTest).

Consider renaming for consistency:

✏️ Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
tests/Phrasing/LabelTest.php (1)

120-131: 🧹 Nitpick | 🔵 Trivial

Nit: Test method name testRenderWithAddAttribute is now misleading.

The method calls setAttribute() but the test name still references "AddAttribute". Consider renaming to testRenderWithSetAttribute for consistency with the updated API. Same applies to testRenderWithAddAttributeUsingEnum (Line 133).

tests/Heading/H1Test.php (1)

127-153: 🧹 Nitpick | 🔵 Trivial

Same nit as in LabelTest: method names testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum still reference "Add" while calling setAttribute().

tests/List/DtTest.php (1)

127-153: 🧹 Nitpick | 🔵 Trivial

Same method naming nit applies here — testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum now test setAttribute().

tests/List/LiTest.php (1)

128-154: 🧹 Nitpick | 🔵 Trivial

Same method naming nit — consider renaming testRenderWithAddAttribute / testRenderWithAddAttributeUsingEnum to reflect setAttribute.

tests/Root/BodyTest.php (1)

127-138: 🧹 Nitpick | 🔵 Trivial

Test method name testRenderWithAddAttribute is now misleading since it tests setAttribute().

The assertion message on line 137 was correctly updated to reference setAttribute(), but the method name on line 127 still says AddAttribute. Same applies to testRenderWithAddAttributeUsingEnum on line 141. Consider renaming for consistency:

♻️ Suggested rename
-    public function testRenderWithAddAttribute(): void
+    public function testRenderWithSetAttribute(): void
-    public function testRenderWithAddAttributeUsingEnum(): void
+    public function testRenderWithSetAttributeUsingEnum(): void
tests/Metadata/BaseTest.php (1)

102-126: 🧹 Nitpick | 🔵 Trivial

Same test method naming inconsistency as noted in BodyTest.

testRenderWithAddAttribute (line 102) and testRenderWithAddAttributeUsingEnum (line 115) still reference "AddAttribute" in their names while now testing setAttribute(). Consider renaming to testRenderWithSetAttribute / testRenderWithSetAttributeUsingEnum for consistency with the updated assertion messages.

🤖 Fix all issues with AI agents
In `@composer.json`:
- Around line 15-19: The composer.json currently pins ui-awesome/html-attribute
to an unstable `@dev` release while bumping ui-awesome/html-helper to ^0.7 and
adding ui-awesome/html-mixin ^0.4 to match the addAttribute()→setAttribute()
migration; replace the unstable "ui-awesome/html-attribute": "^0.6@dev"
constraint with a stable constraint (e.g., the latest released 0.5.x version or
leave it out until a 0.6.x stable is published), or hold the package bump until
ui-awesome/html-attribute has a stable 0.6.x release, then update the constraint
accordingly; after changing the constraint, run composer update to refresh
composer.lock and verify there are no unstable transitive dependencies.

In `@src/Form/InputRadio.php`:
- Line 8: Remove the now-unused import UIAwesome\Html\Core\Html from the top of
the InputRadio file: the run() method was moved to BaseChoice so InputRadio no
longer references Html; update the imports by deleting the line "use
UIAwesome\Html\Core\Html;" (keeping other imports intact) and run tests/static
analysis to ensure no other references to Html remain in the InputRadio class.

In `@tests/Form/InputRadioTest.php`:
- Around line 199-202: Test method names still reference the old API name
addAttribute while the test bodies use setAttribute(); rename the offending test
methods (e.g., change testRenderWithAddAttribute to testRenderWithSetAttribute
and testRenderWithAddAttributeUsingEnum to testRenderWithSetAttributeUsingEnum)
and update any other test method names that mention addAttribute so names match
the new setAttribute API (look for methods in InputRadioTest named
testRenderWithAddAttribute*).

In `@tests/Sectioning/NavTest.php`:
- Line 64: Rename the test methods that still reference the old addAttribute
naming to match the API change to setAttribute: specifically rename
testRenderWithAddAttribute and testRenderWithAddAttributeUsingEnum (and any
other test method names containing "AddAttribute", e.g., the ones reported
around the other occurrences) to use "setAttribute" in their method names and
any related docblocks/assertion messages so names reflect the updated API while
keeping the internal calls (->setAttribute(...)) unchanged.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 139a567 and ad1ad40.

📒 Files selected for processing (79)
  • composer.json
  • src/Embedded/Attribute/HasElementtiming.php
  • src/Embedded/Attribute/HasIsmap.php
  • src/Form/Attribute/HasFormaction.php
  • src/Form/Attribute/HasFormenctype.php
  • src/Form/Attribute/HasFormmethod.php
  • src/Form/Attribute/HasFormnovalidate.php
  • src/Form/Attribute/HasFormtarget.php
  • src/Form/Base/BaseChoice.php
  • src/Form/InputCheckbox.php
  • src/Form/InputRadio.php
  • src/Form/Mixin/CanBeUnchecked.php
  • src/Form/Mixin/HasLabel.php
  • src/List/Attribute/HasReversed.php
  • src/List/Attribute/HasStart.php
  • src/Metadata/Attribute/HasAsync.php
  • src/Metadata/Attribute/HasDefer.php
  • src/Metadata/Attribute/HasNomodule.php
  • src/Metadata/Attribute/HasShadowRootClonable.php
  • src/Metadata/Attribute/HasShadowRootDelegatesFocus.php
  • src/Metadata/Attribute/HasShadowRootMode.php
  • src/Metadata/Attribute/HasShadowRootReferenceTarget.php
  • src/Metadata/Attribute/HasShadowRootSerializable.php
  • src/Phrasing/Label.php
  • tests/Embedded/ImgTest.php
  • tests/Flow/DivTest.php
  • tests/Flow/HrTest.php
  • tests/Flow/MainTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputImageTest.php
  • tests/Form/InputMonthTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputSearchTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputWeekTest.php
  • tests/Heading/H1Test.php
  • tests/Heading/H2Test.php
  • tests/Heading/H3Test.php
  • tests/Heading/H4Test.php
  • tests/Heading/H5Test.php
  • tests/Heading/H6Test.php
  • tests/Heading/HGroupTest.php
  • tests/List/DdTest.php
  • tests/List/DlTest.php
  • tests/List/DtTest.php
  • tests/List/LiTest.php
  • tests/List/OlTest.php
  • tests/List/UlTest.php
  • tests/Metadata/BaseTest.php
  • tests/Metadata/LinkTest.php
  • tests/Metadata/MetaTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Metadata/StyleTest.php
  • tests/Metadata/TemplateTest.php
  • tests/Metadata/TitleTest.php
  • tests/Palpable/ATest.php
  • tests/Phrasing/ITest.php
  • tests/Phrasing/LabelTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/BodyTest.php
  • tests/Root/FooterTest.php
  • tests/Root/HeadTest.php
  • tests/Root/HeaderTest.php
  • tests/Root/HtmlTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Sectioning/NavTest.php
  • tests/Sectioning/SectionTest.php
💤 Files with no reviewable changes (1)
  • src/Form/Mixin/HasLabel.php
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2026-02-06T21:37:44.509Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 24
File: tests/Form/InputTextTest.php:33-620
Timestamp: 2026-02-06T21:37:44.509Z
Learning: In the ui-awesome/html repository, prefer individual test methods over PHPUnit data providers in test classes. This helps maintainers see exactly how each test behaves without cross-referencing data providers. Apply to all PHP test files under tests. Use separate, descriptively named test methods to cover different inputs/edge cases; retain data providers only if they clearly improve readability or reduce duplication.

Applied to files:

  • tests/Form/InputUrlTest.php
  • tests/List/DtTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Heading/HGroupTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputSearchTest.php
  • tests/Flow/MainTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/HtmlTest.php
  • tests/Phrasing/ITest.php
  • tests/Heading/H5Test.php
  • tests/Form/InputRangeTest.php
  • tests/Root/FooterTest.php
  • tests/Form/InputTextTest.php
  • tests/Root/HeadTest.php
  • tests/Palpable/ATest.php
  • tests/Flow/HrTest.php
  • tests/List/DdTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Flow/DivTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputResetTest.php
  • tests/Metadata/StyleTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Form/InputWeekTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Metadata/BaseTest.php
  • tests/Phrasing/LabelTest.php
  • tests/List/LiTest.php
  • tests/Form/InputImageTest.php
  • tests/Metadata/TitleTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Root/HeaderTest.php
  • tests/List/OlTest.php
  • tests/Metadata/LinkTest.php
  • tests/Heading/H1Test.php
  • tests/Form/InputTimeTest.php
  • tests/Heading/H4Test.php
  • tests/Heading/H6Test.php
  • tests/Form/InputMonthTest.php
  • tests/Heading/H2Test.php
  • tests/Sectioning/NavTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputTelTest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/TemplateTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputPasswordTest.php
  • tests/List/DlTest.php
  • tests/Root/BodyTest.php
  • tests/List/UlTest.php
  • tests/Metadata/MetaTest.php
📚 Learning: 2026-02-11T14:56:18.277Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:18.277Z
Learning: In PHP test files under the repository ui-awesome/html (e.g., tests/Form/InputTextTest.php), it is acceptable to use short variable names (e.g., 2-character names like $id). PHPMD's short-variable rule does not need to be strictly followed in test code. During reviews, allow short names in test files and note that this relaxed style applies to tests, while production code should adhere to the standard variable naming conventions.

Applied to files:

  • tests/Form/InputUrlTest.php
  • tests/List/DtTest.php
  • tests/Metadata/NoScriptTest.php
  • tests/Heading/HGroupTest.php
  • tests/Flow/PTest.php
  • tests/Form/InputSearchTest.php
  • tests/Flow/MainTest.php
  • tests/Phrasing/SpanTest.php
  • tests/Root/HtmlTest.php
  • tests/Phrasing/ITest.php
  • tests/Heading/H5Test.php
  • tests/Form/InputRangeTest.php
  • tests/Root/FooterTest.php
  • tests/Form/InputTextTest.php
  • tests/Root/HeadTest.php
  • tests/Palpable/ATest.php
  • tests/Flow/HrTest.php
  • tests/List/DdTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Flow/DivTest.php
  • tests/Sectioning/ArticleTest.php
  • tests/Form/InputResetTest.php
  • tests/Metadata/StyleTest.php
  • tests/Metadata/ScriptTest.php
  • tests/Form/InputWeekTest.php
  • tests/Sectioning/AsideTest.php
  • tests/Metadata/BaseTest.php
  • tests/Phrasing/LabelTest.php
  • tests/List/LiTest.php
  • tests/Form/InputImageTest.php
  • tests/Metadata/TitleTest.php
  • tests/Sectioning/SectionTest.php
  • tests/Root/HeaderTest.php
  • tests/List/OlTest.php
  • tests/Metadata/LinkTest.php
  • tests/Heading/H1Test.php
  • tests/Form/InputTimeTest.php
  • tests/Heading/H4Test.php
  • tests/Heading/H6Test.php
  • tests/Form/InputMonthTest.php
  • tests/Heading/H2Test.php
  • tests/Sectioning/NavTest.php
  • tests/Embedded/ImgTest.php
  • tests/Form/InputTelTest.php
  • tests/Heading/H3Test.php
  • tests/Metadata/TemplateTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputPasswordTest.php
  • tests/List/DlTest.php
  • tests/Root/BodyTest.php
  • tests/List/UlTest.php
  • tests/Metadata/MetaTest.php
📚 Learning: 2026-02-09T11:28:09.334Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 35
File: tests/Provider/Form/CheckedProvider.php:13-14
Timestamp: 2026-02-09T11:28:09.334Z
Learning: In the ui-awesome/html repository, using `str_replace` to adapt shared data provider HTML strings for different input types (e.g., adapting `CheckedProvider` for both `InputCheckboxTest` and `InputRadioTest` by replacing "inputcheckbox-" with "inputradio-" and "checkbox" with "radio") is acceptable and considered clear. Don't suggest refactoring such patterns to avoid string replacement.

Applied to files:

  • tests/Form/InputTextTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputRadioTest.php
📚 Learning: 2026-02-07T18:51:41.006Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 31
File: src/Form/Mixin/HasLabel.php:195-195
Timestamp: 2026-02-07T18:51:41.006Z
Learning: In the ui-awesome/html repository, explicit boolean comparisons (e.g., `isset($var) === false`) are required instead of negation operators (e.g., `!isset($var)`) due to PHPStan strict rules configuration at the highest level.

Applied to files:

  • composer.json
📚 Learning: 2026-02-11T14:56:26.855Z
Learnt from: terabytesoftw
Repo: ui-awesome/html PR: 37
File: tests/Form/InputTextTest.php:448-457
Timestamp: 2026-02-11T14:56:26.855Z
Learning: In the ui-awesome/html repository, short variable names (e.g., 2-character names like `$id`) are acceptable in test files and should not be flagged. PHPMD's short-variable rule does not need to be strictly followed in test code.

Applied to files:

  • composer.json
🧬 Code graph analysis (1)
src/Form/InputRadio.php (1)
src/Form/Base/BaseChoice.php (1)
  • BaseChoice (19-115)
🪛 PHPMD (2.15.0)
src/Form/Base/BaseChoice.php

[warning] 50-50: Avoid variables with short names like $id. Configured minimum length is 3. (undefined)

(ShortVariable)


[error] 100-100: Avoid using static access to class '\UIAwesome\Html\Core\Html' in method 'run'. (undefined)

(StaticAccess)

🔇 Additional comments (63)
src/List/Attribute/HasStart.php (2)

10-10: LGTM!

The @mixin annotation correctly documents the dependency on \UIAwesome\Html\Mixin\HasAttributes, which provides the setAttribute method used in this trait.


31-34: LGTM!

The migration from addAttribute() to setAttribute() is consistent with the updated html-mixin ^0.4 API. The immutable return pattern and public signature are preserved.

tests/Heading/HGroupTest.php (1)

64-64: addAttribute()setAttribute() migration looks correct.

All call sites in this test file have been consistently updated from addAttribute() to setAttribute(), and the assertion messages on lines 137 and 151 were updated to match. No issues.

Also applies to: 135-135, 149-149, 510-510

tests/Palpable/ATest.php (1)

65-74: addAttribute()setAttribute() migration applied correctly.

The method calls at Lines 70, 135, 148, and 530 correctly use the new setAttribute() API, and assertion messages at Lines 137 and 150 are updated to match. The rest of the file is unchanged and looks good.

Also applies to: 128-139, 523-535

tests/Flow/PTest.php (1)

59-68: API rename applied consistently.

All addAttribute() calls replaced with setAttribute(), and assertion messages updated accordingly. Changes are correct.

Also applies to: 127-153, 502-515

src/Embedded/Attribute/HasIsmap.php (1)

10-10: Production trait correctly updated to use setAttribute() with @mixin annotation.

The @mixin \UIAwesome\Html\Mixin\HasAttributes docblock (Line 10) properly informs static analysis that setAttribute() is available, and the implementation at Line 32 correctly delegates to it. This aligns with the broader PR migration.

Also applies to: 30-33

tests/Root/HeaderTest.php (1)

59-68: API rename applied consistently.

Same mechanical addAttribute()setAttribute() migration as the other test files. Changes look correct.

Also applies to: 127-153, 502-515

tests/Form/InputTimeTest.php (1)

183-209: API rename applied correctly across all changed segments.

setAttribute() calls and updated assertion messages are consistent with the broader migration.

Also applies to: 684-697

tests/Form/InputSearchTest.php (1)

184-207: API rename applied correctly.

All addAttribute() calls migrated to setAttribute() with updated assertion messages.

Also applies to: 629-642

tests/Form/InputTelTest.php (1)

185-211: API rename applied correctly.

Consistent addAttribute()setAttribute() migration with updated assertion messages.

Also applies to: 699-712

tests/Form/InputNumberTest.php (1)

184-210: API rename applied correctly.

Consistent addAttribute()setAttribute() migration with updated assertion messages.

Also applies to: 699-712

tests/Form/InputWeekTest.php (1)

191-194: addAttribute()setAttribute() migration looks correct.

The method calls and assertion messages are consistently updated. The removeAttribute test at line 690 also correctly uses setAttribute to set up the attribute before removal.

Also applies to: 205-208, 690-690

tests/Form/InputResetTest.php (1)

190-193: addAttribute()setAttribute() migration is consistent and correct.

Same rename pattern as in the other test files. Method calls and assertion messages are properly aligned.

Also applies to: 204-207, 578-578

tests/Phrasing/ITest.php (1)

62-62: addAttribute()setAttribute() migration is consistent and correct.

All updated call sites and assertion messages align with the new API. The getAttributes() test at line 62 also properly uses setAttribute to set up the state being verified.

Also applies to: 127-129, 140-142, 392-392

tests/Flow/HrTest.php (1)

51-51: LGTM!

The addAttribute()setAttribute() migration is consistent and correctly applied across all changed segments.

Also applies to: 103-105, 116-118, 353-353

tests/Form/InputImageTest.php (1)

191-194: addAttribute()setAttribute() migration is consistent and correct.

Also applies to: 205-208, 677-677

tests/Embedded/ImgTest.php (1)

63-63: LGTM!

The addAttribute()setAttribute() migration is consistent and correctly applied.

Also applies to: 115-117, 128-130, 560-560

tests/Flow/MainTest.php (1)

64-64: LGTM!

The addAttribute()setAttribute() migration is consistent and correctly applied.

Also applies to: 135-137, 149-151, 510-510

src/Embedded/Attribute/HasElementtiming.php (1)

10-37: LGTM!

The @mixin annotation correctly documents the dependency on HasAttributes, and the setAttribute delegation is clean.

src/List/Attribute/HasReversed.php (1)

10-33: LGTM!

Clean migration to setAttribute with proper @mixin annotation.

tests/Metadata/StyleTest.php (1)

70-71: LGTM — setAttribute migration is consistent.

The addAttributesetAttribute replacement in testGetAttributesReturnsAssignedAttributes and testRenderWithRemoveAttribute is correct and aligns with the updated API.

tests/Heading/H6Test.php (1)

64-65: LGTM — consistent setAttribute migration.

All addAttributesetAttribute replacements and message updates are correct and aligned with the API rename.

Also applies to: 135-137, 149-151, 510-511

tests/Root/HtmlTest.php (1)

64-65: LGTM — consistent setAttribute migration.

Also applies to: 135-137, 149-151, 510-511

tests/Metadata/NoScriptTest.php (1)

64-65: LGTM — consistent setAttribute migration.

Also applies to: 135-137, 149-151, 521-522

tests/Metadata/TitleTest.php (1)

64-65: LGTM — consistent setAttribute migration.

Also applies to: 135-137, 149-151, 522-523

tests/Phrasing/SpanTest.php (1)

62-63: LGTM — consistent setAttribute migration.

Also applies to: 125-127, 138-140, 390-391

tests/Metadata/LinkTest.php (1)

62-63: LGTM — consistent setAttribute migration.

Also applies to: 114-116, 127-129, 599-600

tests/Heading/H2Test.php (1)

64-65: LGTM — consistent setAttribute migration.

Also applies to: 135-137, 149-151, 510-511

tests/Heading/H5Test.php (1)

64-64: setAttribute() migration looks correct.

All addAttribute() call sites have been consistently updated to setAttribute(), and assertion messages match the new API. The test logic and expected outputs remain sound.

Also applies to: 135-135, 149-149, 508-508

src/Metadata/Attribute/HasShadowRootClonable.php (1)

10-10: LGTM!

The @mixin annotation and the addAttributesetAttribute migration are consistent with the project-wide refactor.

Also applies to: 34-34

src/Phrasing/Label.php (1)

44-44: LGTM!

Clean migration from addAttribute to setAttribute for the for attribute.

tests/Flow/DivTest.php (1)

64-64: LGTM!

The setAttribute calls and updated assertion messages are consistent with the API migration.

Also applies to: 135-135, 149-149, 510-510

tests/List/OlTest.php (1)

65-65: LGTM!

Consistent setAttribute migration. The test method naming inconsistency (testRenderWithAddAttribute) was noted in the DivTest review and applies here as well.

Also applies to: 136-138, 150-152, 574-574

tests/Sectioning/AsideTest.php (1)

64-64: LGTM!

Consistent setAttribute migration matching the project-wide refactor.

Also applies to: 135-137, 149-151, 510-510

src/Metadata/Attribute/HasShadowRootMode.php (1)

15-15: LGTM!

The @mixin annotation and setAttribute call are consistent with the rest of the migration.

Also applies to: 45-45

tests/Sectioning/SectionTest.php (1)

64-64: LGTM!

Consistent setAttribute migration matching the project-wide refactor.

Also applies to: 135-137, 149-151, 510-510

tests/List/DlTest.php (1)

64-64: LGTM!

Consistent setAttribute migration matching the project-wide refactor.

Also applies to: 135-137, 149-151, 573-573

src/Form/Attribute/HasFormenctype.php (1)

13-36: LGTM!

The @mixin annotation and setAttribute() migration are consistent with the broader refactor.

src/Form/Attribute/HasFormnovalidate.php (1)

10-32: LGTM!

Consistent with the addAttributesetAttribute migration pattern.

src/Metadata/Attribute/HasAsync.php (1)

10-35: LGTM!

Consistent @mixin annotation and setAttribute() migration.

src/Form/Attribute/HasFormtarget.php (1)

13-36: LGTM!

Consistent with the migration pattern across all trait files.

src/Metadata/Attribute/HasShadowRootReferenceTarget.php (1)

13-13: LGTM — consistent migration to setAttribute() with proper @mixin annotation.

The docblock now correctly declares the HasAttributes mixin dependency, and the internal call is updated from addAttribute() to setAttribute(). Method signature and immutability contract are preserved.

Also applies to: 34-37

tests/Root/BodyTest.php (1)

59-68: Remaining setAttribute() call sites look correct.

Lines 64, 510: setAttribute() calls in testGetAttributesReturnsAssignedAttributes and testRenderWithRemoveAttribute are consistent with the API migration. Assertion messages and expected outcomes remain accurate.

Also applies to: 502-515

src/Form/InputRadio.php (1)

32-57: Clean refactor to BaseChoice — shared rendering logic is correctly inherited.

InputRadio now cleanly extends BaseChoice, which encapsulates all the previously duplicated trait usages (CanBeAutofocus, HasCheckedState, HasValue, etc.) and rendering logic (getAttributes(), run()). The loadDefault() correctly uses PHP array union (+) to give InputRadio's own template and type keys precedence over parent defaults.

tests/Metadata/BaseTest.php (1)

52-61: Remaining setAttribute() changes are consistent and correct.

The updates in testGetAttributesReturnsAssignedAttributes (line 57) and testRenderWithRemoveAttribute (line 386) properly reflect the API migration. Test logic and assertions are sound.

Also applies to: 379-391

tests/List/DdTest.php (1)

59-68: setAttribute() migration in attribute retrieval and removal tests looks correct.

Also applies to: 502-515

src/Form/Attribute/HasFormmethod.php (1)

13-13: LGTM — consistent addAttribute()setAttribute() migration with proper @mixin annotation.

Also applies to: 33-36

src/Metadata/Attribute/HasShadowRootDelegatesFocus.php (1)

10-10: LGTM — clean migration to setAttribute() for the boolean shadowrootdelegatesfocus attribute.

Also applies to: 32-35

src/Metadata/Attribute/HasShadowRootSerializable.php (1)

10-10: LGTM — consistent with the PR-wide setAttribute() migration.

Also applies to: 32-35

src/Metadata/Attribute/HasNomodule.php (1)

10-35: LGTM!

The @mixin annotation and setAttribute() delegation are consistent with the project-wide refactor.

src/Metadata/Attribute/HasDefer.php (1)

10-35: LGTM!

Consistent with the addAttributesetAttribute migration.

tests/Sectioning/ArticleTest.php (1)

127-153: LGTM!

Test method names (testRenderWithAddAttribute, testRenderWithAddAttributeUsingEnum) still reference the old addAttribute naming while the calls and messages now use setAttribute. This is a minor inconsistency but not a functional issue — the test names still describe the concept being tested.

tests/Form/InputCheckboxTest.php (2)

190-216: LGTM!

Mechanical addAttributesetAttribute rename in test calls and assertion messages, consistent with the project-wide migration.


737-752: Test verifies labelClass(null) acts as a no-op when label classes already exist.

The test correctly demonstrates that calling labelClass(null) after setting label attributes with a class value (labelAttributes(['class' => 'value'])) preserves the existing class. This behavior is consistent across form elements (InputCheckbox, InputRadio) and appears intentional. However, since this test is newly added, the claim of a "behavioral change" cannot be verified—this may reflect the original design rather than a recent modification from the dependency update.

tests/Metadata/MetaTest.php (1)

52-126: LGTM!

All addAttributesetAttribute renames in test calls and messages are consistent.

src/Form/Attribute/HasFormaction.php (1)

13-35: LGTM!

Consistent @mixin annotation and setAttribute() delegation.

tests/List/UlTest.php (1)

127-153: LGTM!

Consistent setAttribute migration in test calls and messages.

src/Form/Base/BaseChoice.php (3)

47-114: Well-structured rendering logic with clear separation of label placement strategies.

The three rendering paths (no label, external label, enclosed-by-label) are clean and handle the uncheckedValue hidden input consistently across all branches.


78-84: No issue — Label::for() explicitly accepts null values.

The Label::for() method signature is public function for(string|null $value = null): static, which explicitly permits null. The call on line 83 is safe regardless of whether $id is null.

Likely an incorrect or invalid review comment.


96-113: No action needed. The code correctly replaces the {tag} placeholder with the pre-rendered $labelTag (which already contains the input element) rather than separately rendering an additional input element. Test cases confirm this behavior prevents double-rendering.

src/Form/Mixin/CanBeUnchecked.php (1)

1-51: Well-structured immutable trait.

Clean implementation following the immutable-setter pattern consistent with the rest of the codebase. The type union covers the expected form value types.

tests/Form/InputRadioTest.php (1)

746-761: Verify the labelClass(null) behavior change.

The test testRenderWithLabelClassNullValue() explicitly validates that calling labelClass(null) after labelAttributes(['class' => 'value']) retains class="value" in the rendered output. While I could not locate the labelClass() method implementation to confirm the null-handling semantics directly, the test expectation clearly shows the behavior is intentional: null operates as a no-op that preserves existing class attributes rather than clearing them. Confirm this matches the intended API semantics.

src/Form/InputCheckbox.php (1)

31-56: Verify template newline handling with actual rendered output.

The template string '{prefix}\n{unchecked}\n{tag}\n{label}\n{suffix}' uses single quotes where \n is a literal backslash-n, not a newline character. This pattern appears in both InputCheckbox (line 53) and InputRadio (line 54) identically, suggesting intentional design. However, confirm that the template engine or buildElement() method from the parent package correctly interprets this as line separators in the rendered output, or switch to double quotes if actual newlines are required.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@terabytesoftw
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 15, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@terabytesoftw terabytesoftw merged commit d051549 into main Feb 15, 2026
49 checks passed
@terabytesoftw terabytesoftw deleted the fix_mini_7 branch February 15, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant