Skip to content

Rename validators that use callables in their constructor#1658

Merged
henriquemoody merged 3 commits into
Respect:mainfrom
henriquemoody:validator/callables
Feb 2, 2026
Merged

Rename validators that use callables in their constructor#1658
henriquemoody merged 3 commits into
Respect:mainfrom
henriquemoody:validator/callables

Conversation

@henriquemoody

Copy link
Copy Markdown
Member

Closes #1647

@codecov

codecov Bot commented Jan 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.53%. Comparing base (a64e331) to head (63f7753).
⚠️ Report is 3 commits behind head on main.

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.
📢 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.

@henriquemoody henriquemoody force-pushed the validator/callables branch 2 times, most recently from 6da3d71 to 3629d7b Compare January 31, 2026 02:34

Copilot AI left a comment

Copy link
Copy Markdown

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 renames three validators that use callables in their constructor to improve clarity and consistency:

  • CallbackSatisfies
  • CallAfter
  • LazyFactory

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 to v::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.

Comment thread docs/migrating-from-v2-to-v3.md Outdated
Comment thread docs/validators/Each.md Outdated
Comment thread docs/validators/Sorted.md Outdated
Comment thread docs/feature-guide.md Outdated
@henriquemoody henriquemoody force-pushed the validator/callables branch 2 times, most recently from 4086302 to 78eb0f7 Compare January 31, 2026 02:58
@henriquemoody henriquemoody requested a review from alganet January 31, 2026 02:59

@alganet alganet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • The renamed validators should have Changelog entry noting they were renamed.

  • The migration guide should have a section that explains that these validators were renamed.

@henriquemoody henriquemoody force-pushed the validator/callables branch 2 times, most recently from 33f6e5d to bd99202 Compare February 1, 2026 23:59
@henriquemoody henriquemoody requested a review from alganet February 2, 2026 00:00
alganet
alganet previously approved these changes Feb 2, 2026
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)
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)
@henriquemoody henriquemoody merged commit 63f7753 into Respect:main Feb 2, 2026
7 checks passed
@henriquemoody henriquemoody deleted the validator/callables branch February 2, 2026 00:49
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.

3 participants