Skip to content

feat(attribute): Add HasName trait and name() method to manage name attribute for HTML elements.#52

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

feat(attribute): Add HasName trait and name() method to manage name attribute for HTML elements.#52
terabytesoftw merged 1 commit into
mainfrom
feature_25

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 name attribute on HTML elements with built-in validation against standard HTML metadata names including author, description, keywords, viewport, robots, theme-color, application-name, and more.

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

@terabytesoftw terabytesoftw added the enhancement New feature or request label Jan 31, 2026
@terabytesoftw
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

A new public trait HasName is introduced with a name() method to manage the HTML name attribute. Supporting changes include a new MetaName enum containing 12 standard meta name tokens, a new Attribute::NAME enum case, and comprehensive unit tests with a data provider validating the trait's behavior.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Documented enhancement for new HasName trait (Enh #52).
Core Implementation
src/HasName.php, src/Values/Attribute.php, src/Values/MetaName.php
Added HasName trait with name() method for managing name attribute; added Attribute::NAME enum case; added MetaName enum with 12 standard meta name tokens (application-name, author, description, viewport, etc.).
Tests
tests/HasNameTest.php, tests/Support/Provider/NameProvider.php
Added comprehensive unit tests validating immutability, empty rendering, attribute setting, and validation error handling; added data provider with static test cases and MetaName/Attribute enum cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 A name trait hops into the fray,
With MetaName tokens on display,
Each case immutable, no dismay,
HTML metadata finds a way—
Validation guards the names we say! ✨

🚥 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 clearly and specifically describes the main change: adding a HasName trait and name() method for managing the name attribute on HTML elements. It is directly aligned with all file changes in the changeset.

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

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 31, 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.

@terabytesoftw terabytesoftw merged commit 2930499 into main Jan 31, 2026
46 checks passed
@terabytesoftw terabytesoftw deleted the feature_25 branch January 31, 2026 16:16
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