Skip to content

Remove mathematical, niche and deprecated validators#1648

Merged
alganet merged 1 commit intoRespect:mainfrom
alganet:remove-validators
Jan 30, 2026
Merged

Remove mathematical, niche and deprecated validators#1648
alganet merged 1 commit intoRespect:mainfrom
alganet:remove-validators

Conversation

@alganet
Copy link
Copy Markdown
Member

@alganet alganet commented Jan 30, 2026

This commit removes validators described in #1642, refactoring to clean up after their removal.

  • Url was refactored to use the function filter_var instead.
  • tests/bootstrap.php is no longer needed and was removed.
  • Updated migration guide with recommendations for replacements.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 30, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1648      +/-   ##
============================================
+ Coverage     99.14%   99.21%   +0.06%     
+ Complexity      962      927      -35     
============================================
  Files           197      190       -7     
  Lines          2215     2153      -62     
============================================
- Hits           2196     2136      -60     
+ Misses           19       17       -2     

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

Copy link
Copy Markdown

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 PR removes seven validators identified as mathematical, niche, or deprecated according to issue #1642. The changes include removing validator classes, their tests, documentation, and updating all references throughout the codebase.

Changes:

  • Removed seven validators: VideoUrl, Uploaded, PrimeNumber, PhpLabel, PerfectSquare, FilterVar, and Fibonacci
  • Refactored Url validator to use filter_var directly instead of wrapping the removed FilterVar validator
  • Removed tests/bootstrap.php which was only needed for mocking is_uploaded_file in Uploaded validator tests
  • Updated migration guide with replacement recommendations for removed validators

Reviewed changes

Copilot reviewed 59 out of 59 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Validators/*.php Removed 7 validator classes
src/Validators/Url.php Refactored to extend Simple and use filter_var directly
tests/unit/Validators/*.php Removed unit tests for deleted validators
tests/feature/Validators/*.php Removed feature tests for deleted validators
tests/bootstrap.php Removed file (no longer needed)
tests/src/SmokeTestProvider.php Removed references to deleted validators
tests/feature/SerializableTest.php Removed mock setup for Uploaded validator
tests/feature/Validators/DateTimeDiffTest.php Replaced PrimeNumber with Positive in tests
tests/benchmark/ValidatorBench.php Removed mock setup for Uploaded validator
src/Mixins/*.php Removed methods for deleted validators from all mixin interfaces (12 files)
phpunit.xml.dist Updated bootstrap path from tests/bootstrap.php to vendor/autoload.php
phpcs.xml.dist Removed exclusion patterns for deleted tests/bootstrap.php
phpbench.json.dist Updated bootstrap path from tests/bootstrap.php to vendor/autoload.php
docs/validators/*.md Removed documentation for deleted validators (7 files)
docs/validators.md Removed references to deleted validators from all categorizations and lists
docs/migrating-from-v2-to-v3.md Added migration guidance for removed validators (contains errors)

💡 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/migrating-from-v2-to-v3.md Outdated
Comment thread docs/migrating-from-v2-to-v3.md Outdated
Comment thread docs/migrating-from-v2-to-v3.md Outdated
This commit removes validators described in Respect#1642, refactoring
to clean up after their removal.

 - Url was refactored to use the function `filter_var` instead.
 - tests/bootstrap.php is no longer needed and was removed.
 - Updated migration guide with recommendations for replacements.
@alganet alganet marked this pull request as ready for review January 30, 2026 15:28
@alganet alganet merged commit 47f8f82 into Respect:main Jan 30, 2026
7 checks passed
@alganet alganet deleted the remove-validators branch January 30, 2026 16:08
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