fix(docs): Update documentation traits and enums for clarity and consistency.#24
Conversation
📝 WalkthroughWalkthroughThis PR refactors many PHP docblocks across traits and enums to remove "standards-compliant" wording and simplify descriptions; updates one exception message string quoting; tightens a composer dependency version; and adds a changelog entry for Bug Changes
Sequence Diagram(s)(Skipped — changes are documentation, a dependency constraint, and a single-string edit; no new multi-component control flow to visualize.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Global/HasData.php (1)
78-83: Align supported-types wording with actual signature.The sentence “supporting both string and Closure” understates what’s supported (scalar, Stringable, UnitEnum, etc.). Consider broadening the wording to match the signature.
💡 Suggested doc tweak
- * Creates a new instance with the specified custom data attributes, supporting both string and Closure as required - * by the HTML specification for global attributes, and throws an exception for invalid input. + * Creates a new instance with the specified custom data attributes, supporting scalar, Stringable, UnitEnum, + * Closure, and null values, and throws an exception for invalid input.
🤖 Fix all issues with AI agents
In `@src/Global/HasAccesskey.php`:
- Line 18: Update the class/trait docblock in HasAccesskey (the comment that
starts with "Handles the HTML `accesskey` global attributes") to use the
singular form "attribute" instead of "attributes" so it reads "Handles the HTML
`accesskey` global attribute", matching the style of other traits like
CanBeHidden.
In `@src/Global/HasTitle.php`:
- Line 20: Update the docblock comment in the HasTitle trait to use the singular
word "attribute" instead of "attributes" for consistency with other traits like
HasDraggable and HasClass; locate the PHPDoc above the trait declaration
(HasTitle) and change the line that reads "Handles the HTML `title` global
attributes." to "Handles the HTML `title` global attribute."
🧹 Nitpick comments (2)
src/Values/Draggable.php (1)
14-15: Clarify string tokens vs booleans in doc wording.“map to
falseandtrue” can read as booleans; consider using'false'/'true'to match the string enum values.💡 Suggested doc tweak
- * - Enum values map to `false` and `true`. + * - Enum values map to `'false'` and `'true'` tokens.src/Element/HasWidth.php (1)
12-18: Consider refining "manipulation" terminology for immutability.Line 14 uses "manipulation of the
widthattribute," which could be misleading given that line 12 explicitly states this is an "immutable API." Immutable APIs don't manipulate attributes directly; they return new instances with updated values.Additionally, line 18's "Handles the HTML
widthattribute" is somewhat generic and redundant with line 12.♻️ Suggested refinement for clearer terminology
-Provides an immutable API for setting the `width` attribute on HTML elements. +Provides an immutable API for configuring the `width` attribute on HTML elements. * -Intended for use in tags and components that require manipulation of the `width` attribute. +Intended for use in tags and components that require the `width` attribute. * * Key features. * - Designed for use in tags and components. -- Handles the HTML `width` attribute. +- Immutably configures the HTML `width` attribute. * - Immutable method for setting or overriding the `width` attribute.
Pull Request
Summary by CodeRabbit
Documentation
Chores
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.