fix(html): Apply last changes from ui-awesome/html-core package to ui-awesome/html package.#37
fix(html): Apply last changes from ui-awesome/html-core package to ui-awesome/html package.#37terabytesoftw merged 5 commits intomainfrom
ui-awesome/html-core package to ui-awesome/html package.#37Conversation
…`ui-awesome/html` package.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds 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 Changes
Sequence Diagram(s)Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (3)📚 Learning: 2026-02-09T11:28:09.334ZApplied to files:
📚 Learning: 2026-02-06T21:37:44.509ZApplied to files:
📚 Learning: 2026-02-11T14:56:18.277ZApplied to files:
🧬 Code graph analysis (2)tests/Form/InputResetTest.php (3)
tests/Flow/HrTest.php (3)
🪛 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)
✏️ Tip: You can disable this entire section by setting 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. Comment |
…d `Ul` classes.
…` and `InputRadio` classes.
There was a problem hiding this comment.
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 | 🔵 TrivialMinor 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 fromtag()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
📒 Files selected for processing (59)
CHANGELOG.mdsrc/Form/InputCheckbox.phpsrc/List/Dl.phpsrc/List/Ol.phpsrc/List/Ul.phptests/Embedded/ImgTest.phptests/Flow/DivTest.phptests/Flow/HrTest.phptests/Flow/MainTest.phptests/Flow/PTest.phptests/Form/InputCheckboxTest.phptests/Form/InputHiddenTest.phptests/Form/InputNumberTest.phptests/Form/InputPasswordTest.phptests/Form/InputRadioTest.phptests/Form/InputRangeTest.phptests/Form/InputResetTest.phptests/Form/InputSearchTest.phptests/Form/InputSubmitTest.phptests/Form/InputTelTest.phptests/Form/InputTextTest.phptests/Form/InputTimeTest.phptests/Form/InputUrlTest.phptests/Form/InputWeekTest.phptests/Heading/H1Test.phptests/Heading/H2Test.phptests/Heading/H3Test.phptests/Heading/H4Test.phptests/Heading/H5Test.phptests/Heading/H6Test.phptests/Heading/HGroupTest.phptests/List/DdTest.phptests/List/DlTest.phptests/List/DtTest.phptests/List/LiTest.phptests/List/OlTest.phptests/List/UlTest.phptests/Metadata/BaseTest.phptests/Metadata/LinkTest.phptests/Metadata/MetaTest.phptests/Metadata/NoScriptTest.phptests/Metadata/ScriptTest.phptests/Metadata/StyleTest.phptests/Metadata/TemplateTest.phptests/Metadata/TitleTest.phptests/Palpable/ATest.phptests/Phrasing/ITest.phptests/Phrasing/LabelTest.phptests/Phrasing/SpanTest.phptests/Provider/Form/CheckedProvider.phptests/Root/BodyTest.phptests/Root/FooterTest.phptests/Root/HeadTest.phptests/Root/HeaderTest.phptests/Root/HtmlTest.phptests/Sectioning/ArticleTest.phptests/Sectioning/AsideTest.phptests/Sectioning/NavTest.phptests/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.phptests/List/DlTest.phptests/Flow/MainTest.phptests/Form/InputResetTest.phptests/Form/InputTimeTest.phptests/Heading/HGroupTest.phptests/Embedded/ImgTest.phptests/Heading/H6Test.phptests/Flow/PTest.phptests/Form/InputRangeTest.phptests/Form/InputWeekTest.phptests/Heading/H3Test.phptests/Form/InputRadioTest.phptests/Form/InputSubmitTest.phptests/Heading/H5Test.phptests/Form/InputHiddenTest.phptests/List/DdTest.phptests/Heading/H2Test.phptests/Flow/DivTest.phptests/Form/InputUrlTest.phptests/Flow/HrTest.phptests/Form/InputCheckboxTest.phptests/Heading/H4Test.phptests/Form/InputTextTest.phptests/Form/InputPasswordTest.phptests/Form/InputTelTest.phptests/Form/InputNumberTest.phptests/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.phptests/Form/InputTimeTest.phptests/Form/InputRangeTest.phptests/Form/InputWeekTest.phptests/Form/InputRadioTest.phptests/Form/InputHiddenTest.phptests/Form/InputUrlTest.phptests/Form/InputCheckboxTest.phptests/Form/InputTextTest.phptests/Form/InputTelTest.phptests/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 removingLineEndingNormalizerwrappers. 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 inlineDiv::tag()chains. The removal ofLineEndingNormalizeraligns 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-describedbywith string values, booleantrue, string"true", null ID edge case, and prefix/suffix combinations. Well structured with descriptive names.
237-302: Good coverage ofaria-describedbyviaariaAttributes()andattributes()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
afterRunoverride correctly normalizes excessive newlines before delegating to the parent. The pattern is consistent withDl.php(line 82-85) andUl.php(line 92-95). The PHPMDStaticAccesswarning is a false positive here —LineBreakNormalizeris a stateless utility helper where static access is idiomatic.src/List/Ul.php (1)
84-96: LGTM — mirrors the same normalization pattern asOlandDl.Consistent with the other list classes. The PHPMD
StaticAccessflag is a false positive for a stateless utility.tests/Heading/H4Test.php (1)
36-685: LGTM — clean mechanical refactor removingLineEndingNormalizerwrapper.All tests correctly switch to direct fluent
render()/getContent()calls without changing expected HTML outputs. The PHPMDStaticAccesswarnings forH4::tag()andH4::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, removingLineEndingNormalizer.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
LineEndingNormalizerwrappers as the other heading test files.tests/Heading/H5Test.php (1)
36-683: LGTM — consistent with other heading test refactors.Same mechanical removal of
LineEndingNormalizerwrappers. All expected outputs remain unchanged.tests/Form/InputCheckboxTest.php (3)
91-190: Good addition ofaria-describedbytest coverage.These new tests comprehensively cover the
aria-describedbyattribute behavior: explicit string values, booleantrueauto-generating{id}-help,nullid suppression, and interactions with prefix/suffix viaInline::SPAN. The structure follows the individual-test-method preference. Based on learnings: "prefer individual test methods over PHPUnit data providers."
267-335: Good coverage forariaAttributes()andattributes()paths withdescribedby.These tests verify that
aria-describedbywithtrue(both boolean and string'true') is correctly expanded to{id}-helpwhen set throughariaAttributes()andattributes()APIs, not justaddAriaAttribute().
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 expectsinputcheckbox-\w+. Confirm that the auto-generated ID format fromhtml-corestill follows theinputcheckbox-{suffix}pattern.tests/Heading/H2Test.php (1)
1-683: Clean migration to direct rendering assertions.The removal of
LineEndingNormalizerwrappers 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: Thorougharia-describedbytest coverage.Good expansion of test scenarios covering string values, boolean
true,nullid fallback, and prefix/suffix interactions viaInline::SPAN. The convention of deriving{id}-helpfrom the element's id whendescribedbyistrue(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$idis 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 ofLineEndingNormalizer, inline fluent chains, and group annotation consolidation. All expectations correctly reference<h3>tags. No issues.tests/Form/InputSubmitTest.php (1)
75-174: Well-structuredaria-describedbycoverage for submit input.Consistent with the patterns established in
InputHiddenTest— alldescribedbyscenarios (string, boolean, null id, prefix/suffix) are covered throughaddAriaAttribute,ariaAttributes, andattributesAPI paths.tests/List/DdTest.php (1)
1-685: Clean refactoring consistent with heading test updates.Removal of
LineEndingNormalizerand adoption of inline fluent chains forDdtests 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: Consistentaria-describedbytest expansion for time input.All scenarios align with the patterns in
InputHiddenTestandInputSubmitTest.tests/Form/InputUrlTest.php (1)
77-176: Consistentaria-describedbycoverage 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 ofdd()method withLineBreakNormalizerintegration.The
afterRunhook inDl(as seen insrc/List/Dl.php) normalizes excessive newlines, which allows these tests to assert clean HTML without wrapping inLineEndingNormalizer. The multi-itemdd()chaining test verifies the normalization works correctly for consecutive child elements.
418-458:dt()and combineddt()/dd()tests are correct.The expected output structure with proper nesting of
<dt>/<dd>within<dl>is consistent with theDl::dt()andDl::dd()method implementations.
749-763: Immutability assertions are valuable.Good practice to explicitly verify that
dt()anddd()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.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Pull Request