Rename validators that use callables in their constructor#1658
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1658 +/- ##
=========================================
Coverage 99.53% 99.53%
Complexity 923 923
=========================================
Files 190 190
Lines 2171 2171
=========================================
Hits 2161 2161
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6da3d71 to
3629d7b
Compare
There was a problem hiding this comment.
Pull request overview
This pull request renames three validators that use callables in their constructor to improve clarity and consistency:
Callback→SatisfiesCall→AfterLazy→Factory
The renaming addresses issue #1647 which noted that the Call() validator name was cryptic and suggested renaming it to something more intuitive.
Changes:
- Renamed validator classes and updated all corresponding method signatures across builder/chain mixins
- Updated all test files (unit, feature, and smoke tests) to use the new validator names
- Updated comprehensive documentation including validator pages, migration guide, feature guide, and examples
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Validators/Satisfies.php | Renamed Callback class to Satisfies |
| src/Validators/After.php | Renamed Call class to After |
| src/Validators/Factory.php | Renamed Lazy class to Factory and updated parameter name from $validatorCreator to $factory |
| src/Validators/Tld.php | Updated usage from Call to After |
| src/Mixins/*.php (14 files) | Updated all mixin interfaces to replace old method names with new ones across Chain and Builder variants |
| tests/unit/Validators/*.php (3 files) | Renamed test classes and updated all references to use new validator names |
| tests/feature/Validators/*.php (3 files) | Updated feature tests to use new validator method names |
| tests/feature/*.php (4 files) | Updated additional feature tests using the renamed validators |
| tests/src/SmokeTestProvider.php | Replaced old validator entries with new ones and renamed helper method |
| src-dev/Commands/LintSpdxCommand.php | Updated usage from Call to After |
| docs/validators/*.md (10 files) | Updated documentation for renamed validators and cross-references |
| docs/*.md (3 files) | Updated migration guide, feature guide, and case-sensitivity documentation |
Comments suppressed due to low confidence (2)
docs/validators/After.md:41
- This documentation still references the old
v::call()method name, but it should be updated tov::after()to match the renamed validator.
docs/validators/After.md:56 - The word "satisfies" should be "callback" here. This appears to be a copy-paste error from the renaming, as the text is discussing the callback parameter behavior, not the Satisfies validator.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4086302 to
78eb0f7
Compare
alganet
left a comment
There was a problem hiding this comment.
-
The renamed validators should have
Changelogentry noting they were renamed. -
The migration guide should have a section that explains that these validators were renamed.
33f6e5d to
bd99202
Compare
The name "Factory" better conveys the validator's purpose: dynamically creating a validator at runtime based on the input value. "Lazy" was misleading as it suggested simple deferred evaluation rather than input-dependent validator construction. Also renamed the constructor argument from `$validatorCreator` to `$factory` for improved expressiveness. Assisted-by: Claude Code (Opus 4.5)
The previous name was confusing as it focused on the implementation detail (receiving a callback) rather than what the validator actually does. The new name "Satisfies" better conveys the validator's purpose: checking whether the input satisfies a given condition. Assisted-by: Claude Code (Opus 4.5)
bd99202 to
7e63183
Compare
The previous name was confusing as it focused on the implementation detail (calling a callable) rather than what the validator actually does. The new name "After" better conveys the validator's purpose: validating the input after applying a transformation. Assisted-by: Claude Code (Opus 4.5)
7e63183 to
63f7753
Compare
Closes #1647