Conversation
vjik
commented
Sep 25, 2026
Member
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ✔️ |
| Breaks BC? | ❌ |
| Fix #822 |
…le` in the current scope
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #824 +/- ##
============================================
+ Coverage 96.35% 96.37% +0.02%
- Complexity 1152 1158 +6
============================================
Files 124 124
Lines 3540 3563 +23
============================================
+ Hits 3411 3434 +23
Misses 129 129 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Context parameters are not restored when current-scope validation throws an exception.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
What changed in this PR
Fixes #822 by validating wrapped rules within the existing validation scope.
Changes:
- Adds
ValidationContext::validateInCurrentScope(). - Updates three rule wrappers to preserve dataset and property context.
- Adds documentation and regression tests.
| File | Description |
|---|---|
src/ValidationContext.php |
Adds current-scope validation API. |
src/Validator.php |
Implements scoped rule validation and error paths. |
src/Rule/StopOnErrorHandler.php |
Uses current-scope validation. |
src/Rule/CompositeHandler.php |
Uses current-scope validation. |
src/Rule/AnyRuleHandler.php |
Uses current-scope validation. |
tests/ValidationContextTest.php |
Tests the new context API. |
tests/Rule/StopOnErrorTest.php |
Adds scope regression coverage. |
tests/Rule/CompositeTest.php |
Adds scope regression coverage. |
tests/Rule/AnyRuleTest.php |
Adds scope regression coverage. |
tests/Support/Data/PostValidationHookCounter.php |
Supports hook invocation tests. |
docs/guide/en/creating-custom-rules.md |
Documents current-scope validation. |
CHANGELOG.md |
Records the feature and bug fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
