Skip to content

Conversation

@henriquemoody
Copy link
Member

The {{name}} placeholder could represent different things depending on the state of the Result, and referring to it as {{name}} seems arbitrary. This commit changes it to {{subject}}, which is much more generic and it describes well what that placeholder can mean.

@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (8332d28) to head (4840527).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1569   +/-   ##
=========================================
  Coverage     97.48%   97.48%           
  Complexity      987      987           
=========================================
  Files           205      205           
  Lines          2227     2227           
=========================================
  Hits           2171     2171           
  Misses           56       56           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alganet
Copy link
Member

alganet commented Dec 26, 2025

Hey @henriquemoody, can I ask Copilot to do a review here? It is often good at catching possible small details in large diff PRs.

@henriquemoody henriquemoody requested review from Copilot and removed request for alganet December 26, 2025 17:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request replaces the placeholder {{name}} with {{subject}} across the validation library. The change aims to make the placeholder more generic and descriptive, as it can represent different things depending on the validation context (validated input, custom validator name, etc.).

Key Changes:

  • Updated all validation rule template messages to use {{subject}} instead of {{name}}
  • Modified the core message rendering system to provide the subject parameter
  • Updated documentation to reflect the new placeholder naming

Reviewed changes

Copilot reviewed 300 out of 321 changed files in this pull request and generated no comments.

Show a summary per file
File Description
library/Message/InterpolationRenderer.php Updates parameter name from 'name' to 'subject' in the rendering context
library/Rules/*.php (multiple files) Replaces {{name}} with {{subject}} in validation template messages across all rule classes
docs/rules/*.md (multiple files) Updates documentation tables to show {{subject}} instead of {{name}} in template examples and placeholder descriptions
docs/07-custom-rules.md Updates custom rule example to use {{subject}} placeholder
docs/05-message-placeholder-conversion.md Updates documentation explaining parameter stringification behavior
docs/03-handling-exceptions.md Updates exception handling example to use {{subject}}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@henriquemoody
Copy link
Member Author

Good idea, @alganet! What do you think about this renaming? It's quite a big change

@alganet
Copy link
Member

alganet commented Dec 26, 2025

@henriquemoody I like it, subject is a better name!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 300 out of 321 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The `{{name}}` placeholder could represent different things depending on
the state of the Result, and referring to it as `{{name}}` seems
arbitrary. This commit changes it to `{{subject}}`, which is much more
generic and it describes well what that placeholder can mean.
@henriquemoody henriquemoody merged commit 4840527 into Respect:main Dec 26, 2025
5 checks passed
@henriquemoody henriquemoody deleted the core/subject_template branch December 26, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants