fix(docs): Update documentation for HTML attribute elements in Element namespace.#72
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR updates PHPDoc wording across Element attribute traits to target "tag elements" and adjusts docblock links/references; it moves test providers from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (10)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-01-09T16:05:15.502ZApplied to files:
⏰ 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). (14)
🔇 Additional comments (12)
✏️ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/Element/HasUsemap.php`:
- Around line 16-19: Update the docblocks in the HasUsemap trait to replace the
awkward phrase "tags elements" with "tag elements" (singular "tag") in both
occurrences within the class/file documentation (the description lines that
mention intended use for <img> tag elements and the "Designed for use in tag
elements (`<img>`)" line) so the comments read "Intended for use in tag
elements..." and "Designed for use in tag elements (`<img`)."
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (31)
CHANGELOG.mdsrc/Element/HasAlt.phpsrc/Element/HasDecoding.phpsrc/Element/HasHeight.phpsrc/Element/HasHref.phpsrc/Element/HasLoading.phpsrc/Element/HasReferrerpolicy.phpsrc/Element/HasSrc.phpsrc/Element/HasSrcset.phpsrc/Element/HasUsemap.phpsrc/Element/HasWidth.phptests/Element/HasAltTest.phptests/Element/HasDecodingTest.phptests/Element/HasHeightTest.phptests/Element/HasHrefTest.phptests/Element/HasLoadingTest.phptests/Element/HasReferrerpolicyTest.phptests/Element/HasSrcTest.phptests/Element/HasSrcsetTest.phptests/Element/HasUsemapTest.phptests/Element/HasWidthTest.phptests/Provider/Element/AltProvider.phptests/Provider/Element/DecodingProvider.phptests/Provider/Element/HeightProvider.phptests/Provider/Element/HrefProvider.phptests/Provider/Element/LoadingProvider.phptests/Provider/Element/ReferrerpolicyProvider.phptests/Provider/Element/SrcProvider.phptests/Provider/Element/SrcsetProvider.phptests/Provider/Element/UsemapProvider.phptests/Provider/Element/WidthProvider.php
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-09T16:05:15.502Z
Learnt from: terabytesoftw
Repo: ui-awesome/html-attribute PR: 18
File: tests/Support/Provider/Global/ContentEditableProvider.php:32-33
Timestamp: 2026-01-09T16:05:15.502Z
Learning: Preserve the original copyright year in file headers when moving PHP source files between packages within the ui-awesome repositories (e.g., from ui-awesome/html-core to ui-awesome/html-attribute). Do not update the header year to the current year; keep the original creation year as stated in the header. This applies to all PHP files throughout the repo that are moved between packages.
Applied to files:
tests/Element/HasReferrerpolicyTest.phpsrc/Element/HasDecoding.phptests/Element/HasSrcsetTest.phptests/Element/HasHrefTest.phpsrc/Element/HasSrc.phptests/Element/HasHeightTest.phpsrc/Element/HasUsemap.phptests/Element/HasDecodingTest.phptests/Element/HasUsemapTest.phpsrc/Element/HasReferrerpolicy.phpsrc/Element/HasHeight.phptests/Element/HasLoadingTest.phptests/Provider/Element/DecodingProvider.phpsrc/Element/HasAlt.phptests/Provider/Element/WidthProvider.phptests/Provider/Element/HrefProvider.phpsrc/Element/HasWidth.phptests/Provider/Element/SrcsetProvider.phpsrc/Element/HasLoading.phptests/Provider/Element/SrcProvider.phptests/Element/HasWidthTest.phptests/Provider/Element/ReferrerpolicyProvider.phpsrc/Element/HasSrcset.phptests/Element/HasSrcTest.phptests/Element/HasAltTest.phptests/Provider/Element/UsemapProvider.phptests/Provider/Element/AltProvider.phptests/Provider/Element/LoadingProvider.phpsrc/Element/HasHref.phptests/Provider/Element/HeightProvider.php
🧬 Code graph analysis (10)
tests/Element/HasReferrerpolicyTest.php (1)
tests/Provider/Element/ReferrerpolicyProvider.php (1)
ReferrerpolicyProvider(20-86)
tests/Element/HasSrcsetTest.php (1)
tests/Provider/Element/SrcsetProvider.php (1)
SrcsetProvider(19-102)
tests/Element/HasHrefTest.php (1)
tests/Provider/Element/HrefProvider.php (1)
HrefProvider(19-109)
tests/Element/HasHeightTest.php (1)
tests/Provider/Element/HeightProvider.php (1)
HeightProvider(19-95)
tests/Element/HasDecodingTest.php (1)
tests/Provider/Element/DecodingProvider.php (1)
DecodingProvider(20-86)
tests/Element/HasUsemapTest.php (1)
tests/Provider/Element/UsemapProvider.php (1)
UsemapProvider(19-95)
tests/Element/HasLoadingTest.php (1)
tests/Provider/Element/LoadingProvider.php (1)
LoadingProvider(20-86)
tests/Element/HasWidthTest.php (1)
tests/Provider/Element/WidthProvider.php (1)
WidthProvider(19-95)
tests/Element/HasSrcTest.php (1)
tests/Provider/Element/SrcProvider.php (1)
SrcProvider(19-95)
tests/Element/HasAltTest.php (1)
tests/Provider/Element/AltProvider.php (1)
AltProvider(19-95)
⏰ 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). (12)
- GitHub Check: phpunit / PHP 8.5-windows-2022
- GitHub Check: phpunit / PHP 8.1-windows-2022
- GitHub Check: phpunit / PHP 8.2-windows-2022
- GitHub Check: phpunit / PHP 8.3-windows-2022
- GitHub Check: phpunit / PHP 8.4-ubuntu-latest
- GitHub Check: phpunit / PHP 8.3-ubuntu-latest
- GitHub Check: phpunit / PHP 8.2-ubuntu-latest
- GitHub Check: phpunit / PHP 8.4-windows-2022
- GitHub Check: phpunit / PHP 8.5-ubuntu-latest
- GitHub Check: phpunit / PHP 8.1-ubuntu-latest
- GitHub Check: linter / Super Linter
- GitHub Check: linter / Super Linter
🔇 Additional comments (39)
CHANGELOG.md (1)
45-45: LGTM!The changelog entry follows the established format and accurately describes the documentation updates for HTML attribute elements in the
Elementnamespace.tests/Element/HasAltTest.php (1)
11-11: LGTM!The import path update correctly reflects the namespace reorganization from
Tests\Support\Provider\ElementtoTests\Provider\Element, which aligns with the provider's actual location shown in the relevant code snippets.src/Element/HasSrc.php (1)
16-19: LGTM!Documentation updates are consistent with the other trait files in this PR. The same "tags elements" terminology pattern is used (see previous comment on HasUsemap.php regarding potential grammatical improvement).
tests/Element/HasSrcTest.php (1)
11-11: LGTM!The import path update correctly reflects the namespace reorganization, consistent with the changes in other test files. The
SrcProviderclass exists at the new location as confirmed by the relevant code snippets.src/Element/HasWidth.php (1)
16-19: LGTM!Documentation updates are consistent with the pattern across other trait files. The width attribute correctly references both
<img>and<svg>elements as applicable use cases.src/Element/HasDecoding.php (2)
18-21: LGTM!Documentation updates are consistent with the pattern across other trait files in this PR.
56-56: Good addition!The
{@seeDecoding}reference improves discoverability by directing developers to the predefined enum values for the decoding attribute.src/Element/HasLoading.php (1)
18-21: LGTM!The documentation updates appropriately clarify that this trait is intended for tag elements (
<img>and<iframe>) that support theloadingattribute. The addition of the@see Loadingreference in the method docblock (lines 55-56) improves discoverability of the predefined enum values.src/Element/HasSrcset.php (1)
15-18: LGTM!The documentation correctly identifies the supported tag elements (
<img>,<picture>,<source>) and maintains appropriate MDN reference links. The expanded description with bullet points (lines 42-46) improves clarity for developers.src/Element/HasAlt.php (1)
16-19: LGTM!The documentation updates are consistent with the other trait files in this PR. The copyright year (2025) is correctly preserved per the repository convention.
tests/Provider/Element/LoadingProvider.php (1)
5-5: LGTM!The namespace reorganization from
Tests\Support\Provider\ElementtoTests\Provider\Elementis consistent with the broader test structure refactoring in this PR. The variable rename from$staticCaseto$staticCases(line 39) correctly reflects that it holds multiple test cases.tests/Element/HasLoadingTest.php (1)
12-12: LGTM!The import path update correctly reflects the namespace reorganization of
LoadingProviderfromTests\Support\Provider\ElementtoTests\Provider\Element.src/Element/HasHeight.php (1)
16-19: LGTM!The documentation updates correctly specify that this trait is designed for tag elements (
<img>and<svg>) that support theheightattribute. The copyright year (2025) is appropriately preserved.tests/Provider/Element/WidthProvider.php (2)
5-7: LGTM!The namespace reorganization and the switch to using
PHPForge\Support\Stub\{BackedString, Unit}instead of internal stubs is consistent with the broader test infrastructure refactoring in this PR. The copyright year (2025) is correctly preserved.
44-50: Test case key renamed for clarity.The rename from
'enum backed'to'enum backed string'is more descriptive and aligns with the pattern used in other provider files in this PR.tests/Element/HasWidthTest.php (1)
11-11: LGTM!The import path update correctly reflects the provider namespace reorganization from
Support\Provider\ElementtoProvider\Element. TheWidthProviderclass exists at the new location and the test functionality remains unchanged.tests/Provider/Element/SrcsetProvider.php (2)
5-7: LGTM!The namespace reorganization and import migration from internal stubs to
PHPForge\Support\Stub\{BackedString, Unit}are correctly applied. This aligns with the project-wide test provider refactoring.
44-47: LGTM!The test case key rename from
'enum backed'to'enum backed string'appropriately reflects the switch toBackedString::VALUE, maintaining consistency with the type semantics.tests/Element/HasSrcsetTest.php (1)
11-11: LGTM!The import path update correctly aligns with the
SrcsetProvidernamespace migration.tests/Provider/Element/AltProvider.php (1)
5-7: LGTM!The namespace reorganization, import migration to
PHPForge\Support\Stub\{BackedString, Unit}, and test case key rename are correctly applied, consistent with the pattern across all provider files in this refactor.Also applies to: 44-47
src/Element/HasReferrerpolicy.php (2)
18-21: LGTM!The documentation clarifications appropriately narrow the scope from generic "tags and components" to specifically "tags elements" with an accurate enumeration of HTML elements that support
referrerpolicy(<a>,<area>,<iframe>,<img>,<link>, and<script>).
60-60: LGTM!Replacing the external spec link with
{@seeReferrerpolicy}improves developer experience by enabling IDE navigation to the enum definition with predefined values.src/Element/HasHref.php (1)
16-19: LGTM!The documentation update correctly specifies the intended usage for "tags elements" with
<a>and<svg>as the target elements. This is consistent with the documentation pattern applied across otherHas*traits in this PR.tests/Provider/Element/HrefProvider.php (1)
5-7: LGTM!The namespace reorganization, import migration to
PHPForge\Support\Stub\{BackedString, Unit}, and test case key rename are correctly applied, following the consistent pattern established across all provider files in this refactor.Also applies to: 44-47
tests/Element/HasHrefTest.php (1)
11-11: Import path update looks consistent. The provider namespace switch aligns with the test-provider reorg.tests/Provider/Element/HeightProvider.php (2)
5-8: Namespace/import update is consistent with provider relocation.
44-48: Enum-backed case label/value now matches the string-backed scenario. Good clarity improvement for the test data.tests/Element/HasHeightTest.php (1)
11-11: Import path update looks consistent.tests/Provider/Element/DecodingProvider.php (2)
5-5: Namespace update aligns with provider relocation.
39-84: $staticCases rename and spread keep behavior unchanged while improving clarity.tests/Element/HasDecodingTest.php (1)
12-12: Import path update is consistent with provider namespace move.tests/Provider/Element/ReferrerpolicyProvider.php (2)
5-5: Namespace update aligns with provider relocation.
39-84: $staticCases rename and spread keep behavior unchanged while improving clarity.tests/Element/HasReferrerpolicyTest.php (1)
12-12: Import path update looks consistent.tests/Provider/Element/SrcProvider.php (2)
5-7: LGTM! Namespace and import migration looks correct.The namespace change from
Tests\Support\Provider\ElementtoTests\Provider\Elementand the import migration toPHPForge\Support\Stub\{BackedString, Unit}are consistent with the broader refactoring observed across other provider files in this PR.
44-50: LGTM! Test data updated correctly.The key rename from
'enum backed'to'enum backed string'is more descriptive and accurately reflects the test case purpose. The value constant change fromBacked::VALUEtoBackedString::VALUEcorrectly aligns with the new import.tests/Element/HasUsemapTest.php (1)
11-11: LGTM! Import path updated correctly.The import path for
UsemapProvidercorrectly reflects the namespace migration fromTests\Support\Provider\ElementtoTests\Provider\Element, consistent with the provider file's updated namespace.tests/Provider/Element/UsemapProvider.php (2)
5-7: LGTM! Namespace and import migration consistent with PR refactoring.The namespace change to
Tests\Provider\Elementand import migration toPHPForge\Support\Stub\{BackedString, Unit}follow the same pattern applied across other provider files in this PR.
44-47: LGTM! Test data updated consistently.The key rename to
'enum backed string'and value constant change toBackedString::VALUEmirror the updates inSrcProvider.phpand other providers, maintaining consistency across the test infrastructure.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Pull Request