WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@henriquemoody
Copy link
Member

This rule behaves similarly to ``Each, but the difference is that it presents the messages in a simpler manner. This allows users to have a simpler message when validating all items in an array or iterable value.

I’m also introducing the all prefix, making it easier for users to apply the All rule in combination with other rules.

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1578      +/-   ##
============================================
+ Coverage     97.42%   97.44%   +0.01%     
- Complexity      987      991       +4     
============================================
  Files           212      213       +1     
  Lines          2255     2268      +13     
============================================
+ Hits           2197     2210      +13     
  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

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 introduces a new All rule that validates all items in an array or iterable against a given rule, similar to Each but with simplified single-message presentation. It also adds an all prefix to enable composition patterns like v::allStringType().

  • Implements the All rule class extending FilteredNonEmptyArray with simplified messaging
  • Adds all prefix support in the Prefix transformer for easier rule composition
  • Updates all mixin interfaces to support the new rule and prefix patterns

Reviewed changes

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

Show a summary per file
File Description
library/Rules/All.php Core implementation of the All rule with template definition and validation logic
library/Transformers/Prefix.php Adds 'all' to RULES_TO_SKIP and implements prefix transformation for 'all*' methods
library/Mixins/AllChain.php New mixin interface defining chainable methods for all prefixed rules
library/Mixins/AllBuilder.php New mixin interface defining static builder methods for all prefixed rules
library/Mixins/Chain.php Extends Chain interface with AllChain and adds all() method
library/Mixins/Builder.php Extends Builder interface with AllBuilder and adds static all() method
library/Mixins/KeyChain.php Adds keyAll() method signature for composing All rule with Key
library/Mixins/KeyBuilder.php Adds static keyAll() method signature
library/Mixins/NotChain.php Adds notAll() method signature for negating All rule
library/Mixins/NotBuilder.php Adds static notAll() method signature
library/Mixins/NullOrChain.php Adds nullOrAll() method signature for optional validation
library/Mixins/NullOrBuilder.php Adds static nullOrAll() method signature
library/Mixins/PropertyChain.php Adds propertyAll() method signature for object property validation
library/Mixins/PropertyBuilder.php Adds static propertyAll() method signature
library/Mixins/UndefOrChain.php Adds undefOrAll() method signature for undefined-or validation
library/Mixins/UndefOrBuilder.php Adds static undefOrAll() method signature
tests/unit/Rules/AllTest.php Unit tests covering valid and invalid inputs for the All rule
tests/feature/Rules/AllTest.php Feature tests verifying default and inverted template messages
tests/feature/Transformers/PrefixTest.php Tests the all prefix transformation with message validation
docs/rules/All.md Documentation for the All rule with usage examples and categorization
docs/rules/Each.md Adds cross-reference to All rule and fixes trailing whitespace
docs/rules/Length.md Adds cross-references to All and Each rules
docs/rules/Max.md Adds cross-reference to All rule
docs/rules/Min.md Adds cross-reference to All rule
docs/09-list-of-rules-by-category.md Adds All rule to Comparisons, Transformations, and Alphabetically sections
bin/create-mixin Updates mixin generator to include AllBuilder and AllChain with proper configuration

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

@henriquemoody henriquemoody force-pushed the rule/all branch 2 times, most recently from af52ddc to 8836a5d Compare December 29, 2025 15:10
alganet
alganet previously approved these changes Jan 3, 2026
This rule behaves similarly to ``Each, but the difference is that it
presents the messages in a simpler manner. This allows users to have a
simpler message when validating all items in an array or iterable
value.

I’m also introducing the `all` prefix, making it easier for users to
apply the `All` rule in combination with other rules.
@henriquemoody henriquemoody merged commit 0a45eaf into Respect:main Jan 4, 2026
5 checks passed
@henriquemoody henriquemoody deleted the rule/all branch January 4, 2026 11:34
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.

2 participants