-
Notifications
You must be signed in to change notification settings - Fork 774
Standardize and improve validation message templates #1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 standardizes and improves validation message templates across the codebase by removing redundant qualifiers, improving grammar, and enhancing clarity.
Changes:
- Removed redundant "valid" prefixes from 34 validators (e.g., "must be a valid email" → "must be an email address")
- Removed redundant "value" suffixes from 9 type validators (e.g., "must be a string value" → "must be a string")
- Standardized "consist only of" phrasing for 15 character-set validators replacing inconsistent "contain only" or "contain" wording
- Improved file accessibility messages for 7 filesystem validators to be more explicit
- Enhanced grammar and article usage in 5 validators
Reviewed changes
Copilot reviewed 278 out of 278 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Multiple validator source files (src/Validators/*.php) | Updated message templates to remove "valid" prefix, "value" suffix, and standardize phrasing |
| Multiple test files (tests/feature/Validators/*.php) | Updated expected error messages to match new templates |
| Multiple documentation files (docs/validators/*.md) | Updated template examples and added changelog entries for version 3.0.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
20c3d62 to
28b83d3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1670 +/- ##
============================================
- Coverage 99.53% 99.53% -0.01%
- Complexity 923 928 +5
============================================
Files 190 190
Lines 2171 2169 -2
============================================
- Hits 2161 2159 -2
Misses 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
28b83d3 to
8b554a9
Compare
- Remove redundant "valid" prefix: Date, DateTime, DateTimeDiff, Domain, Email, Iban, Imei, Ip, Isbn, Json, LanguageCode, LeapDate, LeapYear, Luhn, MacAddress, NfeAccessKey, Nif, Nip, Pesel, Phone, Pis, PolishIdCard, PostalCode, Roman, Slug, Tld, Url, Uuid, Version. - Remove redundant "value" suffix ArrayVal, BoolVal, Countable, FloatVal, IntVal, IterableVal, NumericVal, ScalarVal, StringVal. - Standardize "consist only of" phrasing Alnum, Alpha, Cntrl, Consonant, Digit, Graph, Lowercase, Printable, Punct, Space, Spaced, Uppercase, Vowel, Xdigit. - Improve file accessibility messages Directory, Executable, File, Image, Readable, SymbolicLink, Writable. - Improve grammar and article usage CreditCard, Extension, Mimetype, Regex, Size.
8b554a9 to
0b79638
Compare
Remove redundant "valid" prefix: Date, DateTime, DateTimeDiff, Domain, Email, Iban, Imei, Ip, Isbn, Json, LanguageCode, LeapDate, LeapYear, Luhn, MacAddress, NfeAccessKey, Nif, Nip, Pesel, Phone, Pis, PolishIdCard, PostalCode, Roman, Slug, Tld, Url, Uuid, Version.
Remove redundant "value" suffix ArrayVal, BoolVal, Countable, FloatVal, IntVal, IterableVal, NumericVal, ScalarVal, StringVal.
Standardize "consist only of" phrasing Alnum, Alpha, Cntrl, Consonant, Digit, Graph, Lowercase, Printable, Punct, Space, Spaced, Uppercase, Vowel, Xdigit.
Improve file accessibility messages Directory, Executable, File, Image, Readable, SymbolicLink, Writable.
Improve grammar and article usage CreditCard, Extension, Mimetype, Regex, Size.