Skip to content

refactor(attribute): Update documentation for various HTML attributes and their usage in elements.#53

Merged
terabytesoftw merged 1 commit into
mainfrom
fix_mini_18
Feb 1, 2026
Merged

refactor(attribute): Update documentation for various HTML attributes and their usage in elements.#53
terabytesoftw merged 1 commit into
mainfrom
fix_mini_18

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

@terabytesoftw terabytesoftw commented Feb 1, 2026

Pull Request

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

Summary by CodeRabbit

  • Documentation
    • Improved and clarified documentation for HTML attributes, specifying which elements support each attribute.
    • Updated reference links to current MDN documentation resources across multiple attribute definitions.
    • Enhanced inline documentation with per-attribute reference links for better clarity and discoverability.

✏️ Tip: You can customize this high-level summary in your review settings.

@terabytesoftw terabytesoftw added the bug Something isn't working label Feb 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

This PR updates documentation across HTML attribute enums to clarify element applicability and add MDN references. It also refactors test data providers, consolidating test case keys, adding UnitEnum imports, and removing backslash escaping from type annotations.

Changes

Cohort / File(s) Summary
Enum Documentation Enhancements
src/Values/AsValue.php, src/Values/Blocking.php, src/Values/Charset.php, src/Values/Crossorigin.php, src/Values/Decoding.php, src/Values/ElementAttribute.php, src/Values/Fetchpriority.php, src/Values/GlobalAttribute.php, src/Values/HttpEquiv.php, src/Values/MetaName.php, src/Values/Target.php
Updated PHPDoc blocks across enum files to clarify element applicability (e.g., link, script, style, img, meta), replaced reference URLs from WHATWG to MDN documentation, added per-case @link annotations, and adjusted em dash phrasing for consistency. No functional changes to enum signatures or values.
Test Class Documentation
tests/Global/HasAriaTest.php, tests/Global/HasDataTest.php, tests/Global/HasEventsTest.php
Added docblock bullets documenting exception behavior for invalid attribute values. Removed leading backslash from UnitEnum type annotation in HasEventsTest. Documentation-only updates to reflect validation error handling.
Test Provider Refactoring
tests/Support/Provider/ContentProvider.php, tests/Support/Provider/Global/ContentEditableProvider.php, tests/Support/Provider/HreflangProvider.php, tests/Support/Provider/ImagesizesProvider.php, tests/Support/Provider/ImagesrcsetProvider.php, tests/Support/Provider/SizesProvider.php, tests/Support/Provider/TargetProvider.php
Consolidated test case keys (e.g., 'string simple' → 'string', 'string en/es/fr' → 'string') and adjusted descriptions for clarity. Added use UnitEnum imports and updated PHPDoc return type annotations to remove backslash escaping from UnitEnum references. Removed redundant test entries in TargetProvider.
Changelog
CHANGELOG.md
Added single entry for bug #53 documenting HTML attribute usage updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 The docs now shine with clarity and light,
MDN links point the way just right,
Test cases consolidated, no fluff in sight,
Type hints cleaned up—a polished sight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: updating documentation for HTML attributes and their usage across multiple files in the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

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

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
Copy Markdown

@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: 1

🤖 Fix all issues with AI agents
In `@tests/Support/Provider/TargetProvider.php`:
- Around line 50-56: The data provider entry keyed 'string' only exercises the
raw string '_self', leaving other raw-string paths untested; update the 'string'
array in tests/Support/Provider/TargetProvider.php (the provider that returns
raw-string cases) to include at least one non-'_self' raw value (e.g. '_blank'
or '_top') with its expected output (e.g. ' target="_blank"') so callers that
pass raw strings are covered; keep the same tuple shape as the existing entries
and add the case alongside the existing '_self' tuple.
🧹 Nitpick comments (1)
tests/Support/Provider/ImagesrcsetProvider.php (1)

46-58: Key renames look good; consider differentiating descriptions.

The key standardization is consistent with the broader refactoring effort. However, both test cases now share the identical description "Should return the attribute value after setting it." which reduces diagnostic clarity if a test fails.

Consider making the 'string with multiple' description more specific:

💡 Optional: Differentiate the description
             'string with multiple' => [
                 'image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w',
                 [],
                 'image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w',
                 ' imagesrcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"',
-                'Should return the attribute value after setting it.',
+                'Should return the attribute value with multiple srcset entries after setting it.',
             ],

Comment thread tests/Support/Provider/TargetProvider.php
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