Skip to content

feat(attribute): Add HasHttpEquiv trait and httpEquiv() method to manage http-equiv attribute for HTML elements.#51

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

feat(attribute): Add HasHttpEquiv trait and httpEquiv() method to manage http-equiv attribute for HTML elements.#51
terabytesoftw merged 1 commit into
mainfrom
feature_24

Conversation

@terabytesoftw
Copy link
Copy Markdown
Contributor

@terabytesoftw terabytesoftw commented Jan 31, 2026

Pull Request

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

Summary by CodeRabbit

  • New Features

    • Added support for managing the http-equiv attribute on HTML elements with validation against predefined values (content-security-policy, content-type, default-style, refresh, x-ua-compatible).
  • Tests

    • Added comprehensive test coverage for http-equiv attribute functionality, including immutability verification and validation of invalid inputs.

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

… manage `http-equiv` attribute for HTML elements.
@terabytesoftw terabytesoftw added the enhancement New feature or request label Jan 31, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

This PR introduces support for the HTML http-equiv attribute by adding a HasHttpEquiv trait with an httpEquiv() method, a new HttpEquiv enum defining allowed values, an Attribute enum case, comprehensive tests, and a data provider.

Changes

Cohort / File(s) Summary
Enhancement Documentation
CHANGELOG.md
Added changelog entry for enhancement #51 introducing the HasHttpEquiv trait and httpEquiv() method.
Value Enums
src/Values/Attribute.php, src/Values/HttpEquiv.php
Added HTTP_EQUIV enum case to Attribute and created new HttpEquiv enum with five standard http-equiv values (content-security-policy, content-type, default-style, refresh, x-ua-compatible).
Attribute Trait
src/HasHttpEquiv.php
Implemented HasHttpEquiv trait providing immutable httpEquiv() method with validation using Validator::oneOf against HttpEquiv enum.
Tests
tests/HasHttpEquivTest.php, tests/Support/Provider/HttpEquivProvider.php
Added comprehensive test class with four test methods covering immutability, empty attributes, valid values, and exception handling; created data provider for multiple test scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 A http-equiv hop of joy!
New attributes to deploy,
Traits and enums aligned with glee,
Headers now flow with certainty.
Tests ensure all works just right,
This enhancement shines so bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 pull request title accurately and specifically summarizes the main change: introducing a HasHttpEquiv trait with an httpEquiv() method for managing the http-equiv HTML attribute. It directly matches the changeset content.

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

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 terabytesoftw merged commit 9adab2b into main Jan 31, 2026
46 checks passed
@terabytesoftw terabytesoftw deleted the feature_24 branch January 31, 2026 15:48
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