Skip to content

feat(attribute): Add HasPing trait and ping() method to manage ping attribute for HTML elements.#55

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

feat(attribute): Add HasPing trait and ping() method to manage ping attribute for HTML elements.#55
terabytesoftw merged 1 commit into
mainfrom
feature_27

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

Release Notes

  • New Features
    • Added support for the HTML ping attribute on elements. This allows you to specify URLs that should be notified when users interact with supported elements, enabling enhanced interaction tracking capabilities.

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

@terabytesoftw terabytesoftw added the enhancement New feature or request label Feb 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 1, 2026

📝 Walkthrough

Walkthrough

This pull request introduces support for the HTML ping attribute through a new HasPing trait that follows the existing attribute management pattern. The trait provides an immutable ping() method, a corresponding PING enum case is added to the Attribute enum, and comprehensive tests validate the functionality.

Changes

Cohort / File(s) Summary
Core Implementation
src/HasPing.php, src/Values/Attribute.php
Introduces the HasPing trait with an immutable ping() method that delegates to addAttribute() with the PING enum case, and adds the PING enum case to the Attribute enum.
Tests
tests/HasPingTest.php, tests/Support/Provider/PingProvider.php
Adds test class HasPingTest with tests for empty attributes, immutability, and attribute value setting; includes PingProvider data provider covering edge cases like empty strings, null values, and multiple URLs.
Documentation
CHANGELOG.md
Updates changelog with a new entry documenting enhancement #55 for the HasPing trait and ping() method.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A ping now flies across the web,
No more attributes to ebb and flow—
The trait hops in with code so clean,
Immutable and swift, pristine,
Our tests ensure it steals the show! 🎉

🚥 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 describes the main change: adding a HasPing trait and ping() method to manage the ping attribute for HTML elements, which is confirmed by all file changes.

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

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 d8bcbfd into main Feb 1, 2026
46 checks passed
@terabytesoftw terabytesoftw deleted the feature_27 branch February 1, 2026 14:31
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