Skip to content

fix(html): Apply last changes from ui-awesome/html-core package to ui-awesome/html package.#37

Merged
terabytesoftw merged 5 commits intomainfrom
feature_15
Feb 11, 2026
Merged

fix(html): Apply last changes from ui-awesome/html-core package to ui-awesome/html package.#37
terabytesoftw merged 5 commits intomainfrom
feature_15

Conversation

@terabytesoftw
Copy link
Contributor

Pull Request

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

@terabytesoftw terabytesoftw added the bug Something isn't working label Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##                main       #37   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       148       151    +3     
===========================================
  Files             73        73           
  Lines            368       378   +10     
===========================================
+ Hits             368       378   +10     

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

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved line break normalization in list elements (Definition Lists, Ordered Lists, Unordered Lists).
  • New Features

    • Enhanced aria-describedby support across form inputs with configurable string and boolean value handling.
  • Changes

    • Simplified ID generation pattern for form elements, removing trailing hyphens from auto-generated identifiers.

Walkthrough

Adds line-break normalization post-processing to list renderers, standardizes newline usage in form input label rendering, updates many form input tests to new ID patterns and expanded aria-describedby coverage, removes line-ending normalization from numerous tests, and updates CHANGELOG.md with a Bug #37 entry.

Changes

Cohort / File(s) Summary
List rendering changes
src/List/Dl.php, src/List/Ol.php, src/List/Ul.php
Switched list item returns to "\n" and added protected function afterRun(string $result): string which calls LineBreakNormalizer::normalize before delegating to parent, to clean up excess blank lines after render.
Form input minor formatting
src/Form/InputCheckbox.php, src/Form/InputRadio.php
Replaced PHP_EOL with "\n" in label HTML construction and reformatted some returned structures; no public API changes.
Changelog
CHANGELOG.md
Added an entry under 0.4.0 (Under development) referencing Bug #37 and syncing html-core → html package changes.
Form input tests
tests/Form/...
(e.g., InputCheckboxTest.php, InputHiddenTest.php, InputNumberTest.php, InputPasswordTest.php, InputRadioTest.php, InputRangeTest.php, InputResetTest.php, InputSearchTest.php, InputSubmitTest.php, InputTelTest.php, InputTextTest.php, InputTimeTest.php, InputUrlTest.php, InputWeekTest.php)
Massive test updates: changed expected IDs from suffixed forms (e.g., inputtext-) to canonical forms (inputtext), added extensive aria-describedby tests (string/boolean/prefix-suffix/attributes combinations), added Inline imports where used, removed LineEndingNormalizer usage, and added many new test methods.
Flow & heading tests
tests/Flow/..., tests/Heading/...
(e.g., DivTest.php, HrTest.php, MainTest.php, PTest.php, H1Test.phpH6Test.php, HGroupTest.php)
Removed LineEndingNormalizer imports/usages and some HTML group annotations; assertions now use direct fluent render chains and inline element construction instead of normalization wrappers.
Embedded & list tests
tests/Embedded/ImgTest.php, tests/List/DdTest.php, tests/List/DlTest.php
Removed LineEndingNormalizer usage; reformatted fluent chains to multiline and inlined element creation; toString expectations updated to direct casts.
Manifest / config
composer.json, manifest_file
Minor manifest references updated (no functional public API changes).

Sequence Diagram(s)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through newlines, trimmed each spare break,
I nudged IDs tidy, for every input's sake.
I added ARIA tests and chased trailing dashes away,
Lists breathe softer now, with cleaned-up display.
A rabbit's tiny cheer — render neatness saved today.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main objective: applying changes from ui-awesome/html-core to ui-awesome/html.
Description check ✅ Passed The description is directly related to the changeset, confirming it's a bugfix that applies changes from ui-awesome/html-core to ui-awesome/html.

✏️ 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 feature_15

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 d06573e and 6f99d49.

📒 Files selected for processing (3)
  • tests/Flow/HrTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputResetTest.php
🧰 Additional context used
🧠 Learnings (3)
📚 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/InputCheckboxTest.php
  • tests/Form/InputResetTest.php
📚 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/Form/InputResetTest.php
  • tests/Flow/HrTest.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/Form/InputResetTest.php
  • tests/Flow/HrTest.php
🧬 Code graph analysis (2)
tests/Form/InputResetTest.php (3)
src/Form/InputReset.php (1)
  • InputReset (30-67)
tests/Form/InputPasswordTest.php (4)
  • testRenderWithAddAriaDescribedByString (86-98)
  • testRenderWithAddAriaDescribedByTrueBooleanValue (100-113)
  • testRenderWithAddAriaDescribedByTrueBooleanValueAndPrefixSuffix (130-149)
  • testRenderWithAddAriaDescribedByTrueBooleanValueString (151-164)
tests/Form/InputRadioTest.php (4)
  • testRenderWithAddAriaDescribedByString (94-106)
  • testRenderWithAddAriaDescribedByTrueBooleanValue (108-121)
  • testRenderWithAddAriaDescribedByTrueBooleanValueAndPrefixSuffix (138-157)
  • testRenderWithAddAriaDescribedByTrueBooleanValueString (159-172)
tests/Flow/HrTest.php (3)
src/Flow/Hr.php (1)
  • Hr (26-39)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
🪛 PHPMD (2.15.0)
tests/Form/InputResetTest.php

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

(ShortVariable)

tests/Flow/HrTest.php

[error] 443-443: Avoid using static access to class '\UIAwesome\Html\Flow\Hr' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

🔇 Additional comments (11)
tests/Flow/HrTest.php (3)

34-35: Group attribute consolidation looks correct.

Removing #[Group('html')] and retaining only #[Group('flow')] aligns with the broader PR pattern of categorizing tests by their semantic element type.


50-52: Multi-line fluent chain formatting is clean and consistent.

The reformatting from single-line to multi-line chained calls improves readability without changing behavior. Applied uniformly across all test methods.

Also applies to: 63-65, 76-78, 89-91, 102-104, 115-117, 128-130, 141-143, 154-162, 173-175, 186-188, 199-201, 223-225, 247-249, 260-262, 286-288, 299-301, 312-314, 325-327, 380-382, 393-395, 406-408, 419-421, 432-434, 454-456, 467-469


439-446: Simplified __toString test — LGTM.

Directly casting (string) Hr::tag() instead of wrapping with LineEndingNormalizer is cleaner and consistent with the PR-wide removal of that normalizer from tests.

The PHPMD StaticAccess hint on line 443 is a false positive — Hr::tag() is the standard factory method used identically in every test in this file.

tests/Form/InputCheckboxTest.php (4)

91-190: Good coverage of aria-describedby edge cases.

The new tests methodically cover the describedby attribute through addAriaAttribute() for string values, boolean true, true with null ID, true with prefix/suffix, and string 'true' — including prefix/suffix variants. The expected outputs are consistent: explicit strings are preserved, true (boolean or string) derives "{id}-help", and a null ID correctly omits the attribute entirely.


267-335: Consistent aria-describedby coverage via ariaAttributes() and attributes() methods.

These tests mirror the addAriaAttribute() tests above but exercise the bulk-setter paths (ariaAttributes([...]) and attributes([...])) for the same describedby true/string scenarios. Good to see both APIs covered.


1013-1022: testRenderWithToString now correctly uses (string) cast.

This addresses the previous review feedback — the test now genuinely invokes __toString() via (string) InputCheckbox::tag()->id(null) instead of calling ->render().


14-14: New Inline import is used and necessary.

Inline::SPAN is referenced in the prefix/suffix describedby tests (lines 147, 149, 183, 185).

tests/Form/InputResetTest.php (4)

75-174: New aria-describedby test coverage looks good.

The new tests comprehensively cover aria-describedby handling across multiple scenarios: explicit string values, boolean true, null ID interaction, and prefix/suffix combinations. The patterns are consistent with those in InputPasswordTest and InputRadioTest.


403-413: LGTM — testRenderWithGenerateId is well-structured.

The regex /^inputreset-\w+$/ correctly validates the auto-generated ID format. The $id short variable name is acceptable in test code. Based on learnings, short variable names like $id are permitted in test files under tests/.


237-263: Consistent aria-describedby coverage via ariaAttributes() method.

These two tests (testRenderWithAriaAttributesAndAriaDescribedByTrueBooleanValue and ...TrueStringValue) both expect the same rendered output aria-describedby="inputreset-help". This correctly verifies that both boolean true and string 'true' are treated equivalently when passed through ariaAttributes(), matching the parallel addAriaAttribute() tests above.


276-302: Same equivalence verified through attributes() method — good coverage.

Tests confirm that aria-describedby set via ->attributes(['aria-describedby' => true]) and ->attributes(['aria-describedby' => 'true']) both produce the same inputreset-help suffix convention, consistent with the other test variants.

✏️ 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.

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: 5

Caution

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

⚠️ Outside diff range comments (1)
tests/Flow/HrTest.php (1)

148-164: 🧹 Nitpick | 🔵 Trivial

Minor formatting inconsistency in testRenderWithAriaAttributes.

The fluent chain here starts Hr::tag()->ariaAttributes(...) on the same line, then indents ->render() differently from the pattern used in other tests (e.g., DivTest, MainTest, HGroupTest) where the chain starts from tag() on a new line. This is cosmetic but worth aligning for consistency.

♻️ Suggested formatting alignment
-            Hr::tag()->ariaAttributes(
-                [
-                    'controls' => static fn(): string => 'modal-1',
-                    'hidden' => false,
-                    'label' => 'Close',
-                ],
-            )
-                ->render(),
+            Hr::tag()
+                ->ariaAttributes(
+                    [
+                        'controls' => static fn(): string => 'modal-1',
+                        'hidden' => false,
+                        'label' => 'Close',
+                    ],
+                )
+                ->render(),
🤖 Fix all issues with AI agents
In `@src/List/Dl.php`:
- Around line 74-86: The current Dl::afterRun method duplicates the
LineBreakNormalizer usage found in Ol::afterRun and Ul::afterRun; extract this
shared behavior into a NormalizesLineBreaks trait to reduce duplication: create
a trait named NormalizesLineBreaks with a protected afterRun(string $result):
string that returns parent::afterRun(LineBreakNormalizer::normalize($result)),
then remove the duplicate afterRun implementations and use the trait in Dl, Ol,
and Ul so each class reuses the shared method while preserving the
parent::afterRun call.

In `@tests/Form/InputCheckboxTest.php`:
- Around line 1013-1024: The test method testRenderWithToString is misleading
because it does not exercise __toString() but calls
InputCheckbox::tag()->id(null)->render(); rename the test to something like
testRenderWithoutId (or similar) and update the assertion message to reflect
rendering without an ID instead of referencing '__toString()'; locate the test
by the method name testRenderWithToString and the call chain
InputCheckbox::tag()->id(null)->render() and change both the method name and the
final assertion message to accurately describe the behavior being verified.

In `@tests/Form/InputHiddenTest.php`:
- Around line 604-615: Rename the misleading test methods and update their
assertion messages to reflect that they call render() (not __toString()); e.g.,
in tests/Form/InputHiddenTest.php change the method name testRenderWithToString
to something like testRenderWithNullId and update the assertion message from
"Failed asserting that '__toString()' method renders correctly." to "Failed
asserting that render() method renders correctly." Do the same pattern for
InputSubmitTest, InputTimeTest, and InputUrlTest where the tests call
InputSubmit::tag()->id(null)->render(), InputTime::tag()->id(null)->render(),
and InputUrl::tag()->id(null)->render() so names and messages match render()
behavior.

In `@tests/Form/InputResetTest.php`:
- Around line 594-605: Rename or update the test so its name and assertion match
what it actually verifies: either rename testRenderWithToString to something
like testRenderWithNullId (or testRenderWithoutId) to reflect that it calls
InputReset::tag()->id(null)->render(), or change the invocation to assert the
__toString() behavior by casting (string) InputReset::tag() (or calling
->__toString()) instead of ->render(); update the assertion message accordingly
so it references the correct behavior (null id render vs __toString()) and keep
references to InputReset::tag(), ->id(null), ->render(), and __toString() to
locate the code.

In `@tests/Form/InputTextTest.php`:
- Around line 448-457: Rename the two-character variable $id in
testRenderWithGenerateId to a 3+ character name (e.g., $generatedId) wherever it
is declared and referenced, including the assignment from
InputText::tag()->getAttribute('id', '') and the subsequent
assertMatchesRegularExpression call, so the test keeps the same behavior but
satisfies PHPMD's short-variable rule.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2340a8a and a828be6.

📒 Files selected for processing (59)
  • CHANGELOG.md
  • src/Form/InputCheckbox.php
  • src/List/Dl.php
  • src/List/Ol.php
  • src/List/Ul.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/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/Provider/Form/CheckedProvider.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 (2)
📚 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/Heading/H1Test.php
  • tests/List/DlTest.php
  • tests/Flow/MainTest.php
  • tests/Form/InputResetTest.php
  • tests/Form/InputTimeTest.php
  • tests/Heading/HGroupTest.php
  • tests/Embedded/ImgTest.php
  • tests/Heading/H6Test.php
  • tests/Flow/PTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputWeekTest.php
  • tests/Heading/H3Test.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputSubmitTest.php
  • tests/Heading/H5Test.php
  • tests/Form/InputHiddenTest.php
  • tests/List/DdTest.php
  • tests/Heading/H2Test.php
  • tests/Flow/DivTest.php
  • tests/Form/InputUrlTest.php
  • tests/Flow/HrTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Heading/H4Test.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputPasswordTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputNumberTest.php
  • tests/Form/InputSearchTest.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/InputResetTest.php
  • tests/Form/InputTimeTest.php
  • tests/Form/InputRangeTest.php
  • tests/Form/InputWeekTest.php
  • tests/Form/InputRadioTest.php
  • tests/Form/InputHiddenTest.php
  • tests/Form/InputUrlTest.php
  • tests/Form/InputCheckboxTest.php
  • tests/Form/InputTextTest.php
  • tests/Form/InputTelTest.php
  • tests/Form/InputSearchTest.php
🧬 Code graph analysis (26)
src/List/Ul.php (2)
src/List/Dl.php (1)
  • afterRun (83-86)
src/List/Ol.php (1)
  • afterRun (99-102)
src/List/Ol.php (2)
src/List/Dl.php (1)
  • afterRun (83-86)
src/List/Ul.php (1)
  • afterRun (93-96)
tests/Heading/H1Test.php (3)
src/Heading/H1.php (1)
  • H1 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/List/DlTest.php (1)
src/List/Dl.php (3)
  • Dl (32-99)
  • dd (47-52)
  • dt (67-72)
tests/Form/InputResetTest.php (1)
src/Form/InputReset.php (1)
  • InputReset (30-67)
tests/Form/InputTimeTest.php (1)
src/Form/InputTime.php (1)
  • InputTime (51-96)
tests/Heading/HGroupTest.php (3)
src/Heading/HGroup.php (1)
  • HGroup (29-42)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
src/List/Dl.php (2)
src/List/Ol.php (1)
  • afterRun (99-102)
src/List/Ul.php (1)
  • afterRun (93-96)
tests/Heading/H6Test.php (3)
src/Heading/H6.php (1)
  • H6 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Flow/PTest.php (4)
src/Flow/P.php (1)
  • P (27-40)
src/Form/InputCheckbox.php (1)
  • getAttributes (67-70)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputRangeTest.php (3)
src/Form/InputRange.php (1)
  • InputRange (48-91)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputWeekTest.php (3)
src/Form/InputWeek.php (1)
  • InputWeek (51-96)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Heading/H3Test.php (3)
src/Heading/H3.php (1)
  • H3 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputRadioTest.php (4)
src/Form/InputRadio.php (2)
  • InputRadio (41-175)
  • uncheckedValue (79-85)
src/Form/Mixin/HasCheckedState.php (1)
  • checked (53-59)
src/Form/Mixin/CanBeEnclosedByLabel.php (1)
  • enclosedByLabel (32-38)
src/Form/Mixin/HasLabel.php (2)
  • label (50-56)
  • labelFor (130-136)
tests/Form/InputSubmitTest.php (6)
src/Form/InputSubmit.php (1)
  • InputSubmit (37-80)
src/Form/Attribute/HasFormaction.php (1)
  • formaction (35-38)
src/Form/Attribute/HasFormenctype.php (1)
  • formenctype (36-39)
src/Form/Attribute/HasFormmethod.php (1)
  • formmethod (35-38)
src/Form/Attribute/HasFormnovalidate.php (1)
  • formnovalidate (32-35)
src/Form/Attribute/HasFormtarget.php (1)
  • formtarget (36-39)
tests/Heading/H5Test.php (3)
src/Heading/H5.php (1)
  • H5 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/List/DdTest.php (3)
src/List/Dd.php (1)
  • Dd (26-39)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Heading/H2Test.php (3)
src/Heading/H2.php (1)
  • H2 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Flow/DivTest.php (4)
src/Flow/Div.php (1)
  • Div (27-40)
src/Form/InputCheckbox.php (1)
  • getAttributes (67-70)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Flow/HrTest.php (3)
src/Flow/Hr.php (1)
  • Hr (26-39)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputCheckboxTest.php (4)
src/Form/Mixin/HasCheckedState.php (1)
  • checked (53-59)
src/Form/Mixin/CanBeEnclosedByLabel.php (1)
  • enclosedByLabel (32-38)
src/Form/Mixin/HasLabel.php (2)
  • label (50-56)
  • labelFor (130-136)
src/Form/InputRadio.php (1)
  • uncheckedValue (79-85)
tests/Heading/H4Test.php (3)
src/Heading/H4.php (1)
  • H4 (27-40)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputTextTest.php (1)
src/Form/InputText.php (1)
  • InputText (45-94)
tests/Form/InputTelTest.php (3)
src/Form/InputTel.php (1)
  • InputTel (46-94)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
tests/Form/InputNumberTest.php (3)
src/Form/InputNumber.php (1)
  • InputNumber (44-90)
tests/Form/InputUrlTest.php (2)
  • testRenderWithAddAriaDescribedByString (77-89)
  • testRenderWithGenerateId (438-448)
tests/Form/InputWeekTest.php (2)
  • testRenderWithAddAriaDescribedByString (75-87)
  • testRenderWithGenerateId (436-446)
tests/Form/InputSearchTest.php (4)
src/Form/InputSearch.php (1)
  • InputSearch (49-98)
tests/Form/InputSubmitTest.php (1)
  • testRenderWithGenerateId (491-501)
tests/Support/Stub/DefaultProvider.php (1)
  • DefaultProvider (17-34)
tests/Support/Stub/DefaultThemeProvider.php (1)
  • DefaultThemeProvider (17-39)
🪛 PHPMD (2.15.0)
src/List/Ul.php

[error] 95-95: Avoid using static access to class '\UIAwesome\Html\Helper\LineBreakNormalizer' in method 'afterRun'. (undefined)

(StaticAccess)

src/List/Ol.php

[error] 101-101: Avoid using static access to class '\UIAwesome\Html\Helper\LineBreakNormalizer' in method 'afterRun'. (undefined)

(StaticAccess)

tests/Heading/H1Test.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\H1' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Heading\H1' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/List/DlTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\List\Dl' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 700-700: Avoid using static access to class '\UIAwesome\Html\List\Dl' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Flow/MainTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Flow\Main' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Flow\Main' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputResetTest.php

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

(ShortVariable)

tests/Form/InputTimeTest.php

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

(ShortVariable)

tests/Heading/HGroupTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\HGroup' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 635-635: Avoid using static access to class '\UIAwesome\Html\Heading\HGroup' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

src/List/Dl.php

[error] 85-85: Avoid using static access to class '\UIAwesome\Html\Helper\LineBreakNormalizer' in method 'afterRun'. (undefined)

(StaticAccess)

tests/Embedded/ImgTest.php

[error] 689-689: Avoid using static access to class '\UIAwesome\Html\Embedded\Img' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Heading/H6Test.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\H6' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Heading\H6' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Flow/PTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Flow\P' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Flow\P' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputRangeTest.php

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

(ShortVariable)

tests/Form/InputWeekTest.php

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

(ShortVariable)

tests/Heading/H3Test.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\H3' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Heading\H3' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputSubmitTest.php

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

(ShortVariable)

tests/Heading/H5Test.php

[error] 237-237: Avoid using static access to class '\UIAwesome\Html\Heading\H5' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 635-635: Avoid using static access to class '\UIAwesome\Html\Heading\H5' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputHiddenTest.php

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

(ShortVariable)

tests/List/DdTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\List\Dd' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\List\Dd' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Heading/H2Test.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\H2' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 635-635: Avoid using static access to class '\UIAwesome\Html\Heading\H2' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Flow/DivTest.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Flow\Div' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Flow\Div' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputUrlTest.php

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

(ShortVariable)

tests/Flow/HrTest.php

[error] 442-442: Avoid using static access to class '\UIAwesome\Html\Flow\Hr' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Heading/H4Test.php

[error] 239-239: Avoid using static access to class '\UIAwesome\Html\Heading\H4' in method 'testRenderWithBeginEnd'. (undefined)

(StaticAccess)


[error] 637-637: Avoid using static access to class '\UIAwesome\Html\Heading\H4' in method 'testRenderWithToString'. (undefined)

(StaticAccess)

tests/Form/InputTextTest.php

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

(ShortVariable)

tests/Form/InputPasswordTest.php

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

(ShortVariable)

tests/Form/InputTelTest.php

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

(ShortVariable)

tests/Form/InputNumberTest.php

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

(ShortVariable)

tests/Form/InputSearchTest.php

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

(ShortVariable)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: phpunit / PHP 8.2-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.5-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.5-windows-2022
  • GitHub Check: phpunit / PHP 8.3-ubuntu-latest
  • GitHub Check: linter / Super Linter
🔇 Additional comments (39)
tests/Flow/PTest.php (1)

39-684: Clean test refactoring — LGTM.

The migration from intermediate variables to inline fluent P::tag() chains is consistent and correct across all test methods. Expected HTML outputs remain unchanged, and each test is well-isolated with a descriptive name. The PHPMD static-access warnings (lines 239, 637) are false positives for this factory-method pattern.

src/Form/InputCheckbox.php (1)

136-142: LGTM — formatting-only change.

The multi-line array formatting improves readability without altering behavior.

tests/Heading/HGroupTest.php (1)

39-683: Clean test refactoring — inline construction is consistent throughout.

All tests use the preferred pattern of individual test methods with inline HGroup::tag()->... chains, consistently removing LineEndingNormalizer wrappers. No logic changes to assertions. Based on learnings, individual test methods are preferred in this repository.

tests/Flow/DivTest.php (1)

36-685: LGTM — consistent refactoring to inline construction and direct rendering.

Tests properly cover all global attributes for the <div> element using individual methods and inline Div::tag() chains. The removal of LineEndingNormalizer aligns with the broader PR pattern.

tests/Embedded/ImgTest.php (1)

46-888: LGTM — formatting and normalization cleanup for Img tests.

Comprehensive test coverage for all image and global attributes, immutability, and invalid argument exceptions. The refactoring to inline chains and direct rendering is consistent with the PR pattern.

tests/Flow/HrTest.php (1)

34-487: LGTM — clean test refactoring for Hr.

All tests properly cover void element rendering with global attributes using inline Hr::tag() chains and direct rendering.

tests/Flow/MainTest.php (1)

36-685: LGTM — consistent inline construction for Main tests.

The refactoring mirrors the pattern across other flow and heading test files. Individual test methods with inline Main::tag() chains are clean and readable.

tests/Form/InputResetTest.php (3)

75-174: Thorough aria-describedby test coverage.

The new tests comprehensively cover aria-describedby with string values, boolean true, string "true", null ID edge case, and prefix/suffix combinations. Well structured with descriptive names.


237-302: Good coverage of aria-describedby via ariaAttributes() and attributes() helpers.

These tests validate that the describedby behavior works consistently regardless of which attribute-setting API is used.


403-413: Good addition of dynamic ID generation test.

The regex /^inputreset-\w+$/ correctly validates that a random suffix is appended when no explicit ID is provided.

CHANGELOG.md (1)

25-25: LGTM — changelog entry correctly references PR #37.

src/List/Ol.php (1)

90-102: LGTM — consistent post-render normalization across list types.

The afterRun override correctly normalizes excessive newlines before delegating to the parent. The pattern is consistent with Dl.php (line 82-85) and Ul.php (line 92-95). The PHPMD StaticAccess warning is a false positive here — LineBreakNormalizer is a stateless utility helper where static access is idiomatic.

src/List/Ul.php (1)

84-96: LGTM — mirrors the same normalization pattern as Ol and Dl.

Consistent with the other list classes. The PHPMD StaticAccess flag is a false positive for a stateless utility.

tests/Heading/H4Test.php (1)

36-685: LGTM — clean mechanical refactor removing LineEndingNormalizer wrapper.

All tests correctly switch to direct fluent render() / getContent() calls without changing expected HTML outputs. The PHPMD StaticAccess warnings for H4::tag() and H4::end() are false positives — this is the standard factory pattern used throughout the codebase. Test structure follows the preference for individual test methods.

tests/Heading/H1Test.php (1)

36-685: LGTM — same mechanical refactor as H4Test, removing LineEndingNormalizer.

Consistent changes across all heading tests. Expected HTML outputs remain unchanged. Structure follows individual test method preference per learnings.

tests/Heading/H6Test.php (1)

36-685: LGTM — consistent with other heading test refactors.

Same mechanical removal of LineEndingNormalizer wrappers as the other heading test files.

tests/Heading/H5Test.php (1)

36-683: LGTM — consistent with other heading test refactors.

Same mechanical removal of LineEndingNormalizer wrappers. All expected outputs remain unchanged.

tests/Form/InputCheckboxTest.php (3)

91-190: Good addition of aria-describedby test coverage.

These new tests comprehensively cover the aria-describedby attribute behavior: explicit string values, boolean true auto-generating {id}-help, null id suppression, and interactions with prefix/suffix via Inline::SPAN. The structure follows the individual-test-method preference. Based on learnings: "prefer individual test methods over PHPUnit data providers."


267-335: Good coverage for ariaAttributes() and attributes() paths with describedby.

These tests verify that aria-describedby with true (both boolean and string 'true') is correctly expanded to {id}-help when set through ariaAttributes() and attributes() APIs, not just addAriaAttribute().


625-635: Verify the auto-generated ID regex still matches after the ID normalization changes.

Manually-set IDs throughout this file now use inputcheckbox (no trailing hyphen), while the auto-generated ID regex expects inputcheckbox-\w+. Confirm that the auto-generated ID format from html-core still follows the inputcheckbox-{suffix} pattern.

tests/Heading/H2Test.php (1)

1-683: Clean migration to direct rendering assertions.

The removal of LineEndingNormalizer wrappers and intermediate variables in favor of inline fluent chains is consistent and correct. All test expectations align with the H2 component behavior. The PHPMD static access warnings on Lines 239 and 635 are false positives — H2::end() and (string) H2::tag() are standard factory/end patterns in this library.

tests/Form/InputHiddenTest.php (2)

74-173: Thorough aria-describedby test coverage.

Good expansion of test scenarios covering string values, boolean true, null id fallback, and prefix/suffix interactions via Inline::SPAN. The convention of deriving {id}-help from the element's id when describedby is true (or the string 'true') is well-covered through multiple API entry points (addAriaAttribute, ariaAttributes, attributes).


424-434: LGTM — generate-id test is correct.

The regex /^inputhidden-\w+$/ validates that a dynamic ID is auto-generated when none is explicitly set. The PHPMD short-variable warning for $id is a false positive in this test context.

tests/Heading/H3Test.php (1)

1-685: Consistent migration matching H2Test.

Same mechanical changes as H2Test.php — removal of LineEndingNormalizer, inline fluent chains, and group annotation consolidation. All expectations correctly reference <h3> tags. No issues.

tests/Form/InputSubmitTest.php (1)

75-174: Well-structured aria-describedby coverage for submit input.

Consistent with the patterns established in InputHiddenTest — all describedby scenarios (string, boolean, null id, prefix/suffix) are covered through addAriaAttribute, ariaAttributes, and attributes API paths.

tests/List/DdTest.php (1)

1-685: Clean refactoring consistent with heading test updates.

Removal of LineEndingNormalizer and adoption of inline fluent chains for Dd tests mirrors the heading test changes exactly. All <dd> tag expectations are correct. PHPMD static access warnings are false positives for factory/end patterns.

tests/Form/InputTimeTest.php (1)

75-174: Consistent aria-describedby test expansion for time input.

All scenarios align with the patterns in InputHiddenTest and InputSubmitTest.

tests/Form/InputUrlTest.php (1)

77-176: Consistent aria-describedby coverage for URL input.

All test scenarios follow the established patterns across the form input test suite.

tests/List/DlTest.php (3)

315-334: Good coverage of dd() method with LineBreakNormalizer integration.

The afterRun hook in Dl (as seen in src/List/Dl.php) normalizes excessive newlines, which allows these tests to assert clean HTML without wrapping in LineEndingNormalizer. The multi-item dd() chaining test verifies the normalization works correctly for consecutive child elements.


418-458: dt() and combined dt()/dd() tests are correct.

The expected output structure with proper nesting of <dt>/<dd> within <dl> is consistent with the Dl::dt() and Dl::dd() method implementations.


749-763: Immutability assertions are valuable.

Good practice to explicitly verify that dt() and dd() return new instances, confirming the immutable fluent API contract.

tests/Form/InputTextTest.php (1)

76-175: Solid aria-describedby coverage with prefix/suffix and id-null paths.

The new cases cover boolean vs. string values and wrapper rendering, which should guard against regressions.

tests/Form/InputRadioTest.php (1)

94-193: Nice expansion of aria-describedby coverage with prefix/suffix cases.

These additions align the radio tests with the broader input suite and exercise the key describedby paths.

tests/Form/InputWeekTest.php (1)

75-175: Solid aria-describedby coverage with prefix/suffix and id-null paths.

The added cases mirror the other inputs and should help prevent regressions.

tests/Form/InputRangeTest.php (1)

75-175: Solid aria-describedby coverage with prefix/suffix and id-null paths.

The added cases align with the suite-wide behavior changes.

tests/Form/InputTelTest.php (1)

77-176: Solid aria-describedby coverage with prefix/suffix and id-null paths.

These cases bring the tel input in line with the updated describedby behavior.

tests/Form/InputPasswordTest.php (1)

86-185: Solid aria-describedby coverage with prefix/suffix and id-null paths.

Good alignment with the suite-wide describedby behavior additions.

tests/Form/InputSearchTest.php (1)

76-175: Solid aria-describedby coverage with prefix/suffix and id-null paths.

These additions match the updated behavior across the input suite.

tests/Form/InputNumberTest.php (1)

85-185: Solid aria-describedby coverage with prefix/suffix and id-null paths.

The test suite now consistently exercises describedby behaviors for number inputs.

✏️ 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 11, 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.

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