Skip to content

Remove Yes and No rules#1598

Merged
henriquemoody merged 1 commit into
Respect:mainfrom
henriquemoody:rule/yes_and_no
Jan 10, 2026
Merged

Remove Yes and No rules#1598
henriquemoody merged 1 commit into
Respect:mainfrom
henriquemoody:rule/yes_and_no

Conversation

@henriquemoody
Copy link
Copy Markdown
Member

I created those validators to make it easy to parse parameters or console command inputs that were answers to questions one might ask.

One of the biggest problems is that it depends on the machine's locale, which can be a bit troublesome, rather than receiving a locale in the constructor. That doesn’t allow for a lot of flexibility when someone has a multi-lingual application. Additionally, these validators rely on the regex from nl_langinfo(), which is very permissive, resulting in false positives.

I have a working version of a console command that retrieves data from the Unicode Common Locale Data Repository (CLDR) and updates a list of yesstr and nostr strings from the main XML file of each language. However, I came to realise that the whole thing is not worth it.

The validators Yes and No can be replaced by using rules like Regex and In. They won’t have the ease of multilingual support, but I don’t think those validators are used a lot. So, I decided I would just remove them, and if users really ask for it in the next major version, I’d be happy to revive my branch.

I created those validators to make it easy to parse parameters or
console command inputs that were answers to questions one might ask.

One of the biggest problems is that it depends on the machine's locale,
which can be a bit troublesome, rather than receiving a locale in the
constructor. That doesn’t allow for a lot of flexibility when someone
has a multi-lingual application. Additionally, these validators rely on
the regex from `nl_langinfo()`, which is very permissive, resulting in
false positives.

I have a working version of a console command that retrieves data from
the Unicode Common Locale Data Repository (CLDR) and updates a list of
`yesstr` and `nostr` strings from the main XML file of each language.
However, I came to realise that the whole thing is not worth it.

The validators Yes and No can be replaced by using rules like `Regex`
and `In`. They won’t have the ease of multilingual support, but I don’t
think those validators are used a lot. So, I decided I would just remove
them, and if users really ask for it in the next major version, I’d be
happy to revive my branch.
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 10, 2026

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1598      +/-   ##
============================================
- Coverage     97.44%   97.43%   -0.02%     
+ Complexity      988      981       -7     
============================================
  Files           213      211       -2     
  Lines          2273     2259      -14     
============================================
- Hits           2215     2201      -14     
  Misses           58       58              

☔ 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 pull request removes the Yes and No validators from the validation library due to their reliance on locale-dependent behavior that is problematic and hard to maintain. The validators depended on nl_langinfo() with locale constants which were overly permissive and caused false positives.

Changes:

  • Removed Yes and No validator classes and their associated tests
  • Removed documentation for the removed validators and updated references in related docs
  • Cleaned up CI workflow by removing locale generation steps that were only needed for these validators

Reviewed changes

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

Show a summary per file
File Description
library/Validators/Yes.php Deleted Yes validator implementation
library/Validators/No.php Deleted No validator implementation
tests/unit/Validators/YesTest.php Deleted unit tests for Yes validator
tests/unit/Validators/NoTest.php Deleted unit tests for No validator
tests/feature/Validators/YesTest.php Deleted feature tests for Yes validator
tests/feature/Validators/NoTest.php Deleted feature tests for No validator
library/Mixins/*.php Removed yes() and no() method declarations from all mixin interfaces (Chain, Builder, and their variants)
docs/validators/Yes.md Deleted documentation for Yes validator
docs/validators/No.md Deleted documentation for No validator
docs/validators/BoolVal.md Removed references to Yes and No validators from "See also" section
docs/validators/BoolType.md Removed references to Yes and No validators from "See also" section
docs/list-of-validators-by-category.md Removed Yes and No from both categorical and alphabetical validator lists
.github/workflows/continuous-integration.yml Removed locale generation steps (nl_NL, pt_BR, ru_RU) that were only needed for Yes/No validator tests

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

@henriquemoody henriquemoody merged commit 6022914 into Respect:main Jan 10, 2026
11 checks passed
@henriquemoody henriquemoody deleted the rule/yes_and_no branch January 10, 2026 05:01
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