Skip to content

feat(attribute): Add HasIntegrity trait and integrity() method to manage integrity attribute for HTML elements.#37

Merged
terabytesoftw merged 1 commit into
mainfrom
fix_mini_15
Jan 30, 2026
Merged

feat(attribute): Add HasIntegrity trait and integrity() method to manage integrity attribute for HTML elements.#37
terabytesoftw merged 1 commit into
mainfrom
fix_mini_15

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
    • Introduced a new capability to manage the HTML integrity attribute on elements using an immutable API method. This enables Subresource Integrity (SRI) verification on script and link tags, allowing validation of external resource authenticity and integrity.

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

… manage `integrity` 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

Introduces a new HasIntegrity trait for managing HTML integrity attributes on elements. Includes the trait implementation, an INTEGRITY enum case, comprehensive unit tests with a data provider, and a changelog entry documenting the addition.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added new entry documenting HasIntegrity trait capability in version 0.5.3.
Core Implementation
src/HasIntegrity.php, src/Values/Attribute.php
New trait providing immutable integrity() method delegating to addAttribute() with Attribute::INTEGRITY enum case; enum case added to Attribute class.
Test Suite
tests/HasIntegrityTest.php, tests/Support/Provider/IntegrityProvider.php
Test class validating immutability and attribute rendering behavior; data provider supplying test cases covering null, string, and override scenarios.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A trait for integrity, oh what delight!
HTML elements now shine so bright
Subresource safety wrapped up with care
Immutable and clean, beyond compare
The rabbit hops forward with attributes to share! ✨

🚥 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 accurately and specifically describes the main change: adding a HasIntegrity trait and integrity() method to manage the integrity attribute for HTML elements, which is reflected in all modified files.

✏️ 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_15

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.

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