Skip to content

feat(attribute): Add HasDisabled trait and disabled() method to manage disabled attribute for HTML elements.#44

Merged
terabytesoftw merged 1 commit into
mainfrom
feature_18
Jan 31, 2026
Merged

feat(attribute): Add HasDisabled trait and disabled() method to manage disabled attribute for HTML elements.#44
terabytesoftw merged 1 commit into
mainfrom
feature_18

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

@terabytesoftw terabytesoftw commented Jan 30, 2026

Pull Request

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for managing the disabled attribute on HTML elements through an immutable API.
  • Tests

    • Added comprehensive test suite for disabled attribute functionality.

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

…anage `disabled` attribute for HTML elements.
@terabytesoftw terabytesoftw added the enhancement New feature or request label Jan 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

A new HasDisabled trait is introduced to manage the HTML disabled attribute on elements with an immutable API. The implementation includes comprehensive unit tests and a test data provider with various disabled attribute scenarios.

Changes

Cohort / File(s) Summary
Trait Implementation
src/HasDisabled.php, CHANGELOG.md
New trait providing an immutable disabled(bool|null $value): static method that delegates to addAttribute() for managing the disabled HTML attribute.
Test Suite
tests/HasDisabledTest.php, tests/Support/Provider/DisabledProvider.php
Unit tests verifying immutability, default behavior, attribute setting, and attribute rendering. Includes data provider supplying test cases for null, true, false, replacement, and unsetting scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hopping through HTML, I've crafted with care,
A HasDisabled trait beyond compare!
When buttons must rest and links need to pause,
This immutable trait will win your applause! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a HasDisabled trait and disabled() method to manage the disabled HTML attribute.

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

@terabytesoftw
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 30, 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

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant