Changelog
All notable changes to Valicomb are documented on this page.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.2.0] - 2026-01-11
Section titled “[1.2.0] - 2026-01-11”Highlights
Section titled “Highlights”Fluent Field Builder - Chain validation methods with full IDE autocomplete:
$v->field('email') ->required() ->email() ->lengthMax(254);Simplified API - Use forFields() for both single and multiple field validation:
$v->forFields([ 'email' => ['required', 'email'], 'password' => ['required', ['lengthMin', 8]],]);field()method for fluent validation with IDE autocomplete support- Documentation website using Astro Starlight
- Strict mode for stricter validation behavior
- Inline custom messages support for per-rule error messages
- New validation rules:
urlStrict,uuid,startsWith,endsWith,decimalPlaces,positive,past,future,phone,requiredWith,requiredWithout,IPv4,IPv6,ASCII,arrayHasKeys - Case-insensitive option for string matching rules
Deprecated
Section titled “Deprecated”mapOneFieldToRules()→ UseforFields()insteadmapFieldRules()→ UseforFields()insteadmapFieldsRules()→ UseforFields()instead
- Resolved multiple issues from the original Valitron library
[1.1.0] - 2026-01-04
Section titled “[1.1.0] - 2026-01-04”- Documentation website using Astro Starlight
- Strict mode for stricter validation behavior
- Inline custom messages support for per-rule error messages
- New validation rules:
urlStrictfor URL validation with required schemeuuidwith support for versions 1-5startsWithandendsWithfor string prefix/suffix validationdecimalPlacesfor controlling decimal precisionpositivefor strictly positive numberspastandfuturefor date validationphonewith support for 12 countriesrequiredWith/requiredWithoutfor conditional validationIPv4/IPv6/ASCIIfor network and character validationarrayHasKeysfor required array keys
- Case-insensitive option for string matching rules
- Resolved multiple issues from the original Valitron library (see Valitron Issues Fixed for details)
[1.0.1] - 2025-11-16
Section titled “[1.0.1] - 2025-11-16”Complete rewrite of the Valitron validation library for modern PHP.
Core Features
Section titled “Core Features”- PHP 8.2+ with strict types throughout
- Zero dependencies (only
ext-mbstringrequired) - Automatic ReDoS pattern detection
- RFC 5321 email validation with length limits
- PHPStan Level 8 compliance
- PSR-12 code style
- 430+ tests
- 33 language translations
Architecture
Section titled “Architecture”- Extracted core classes (ErrorManager, LanguageManager, RuleRegistry)
- Organized validation rules into trait files
- Clean separation of concerns
Changed
Section titled “Changed”numericrule now properly handles scientific notation (e.g.,1.2e3)- Strict equality comparisons (no type juggling)
- Path traversal protection in language loading
Security & Quality Fixes
Section titled “Security & Quality Fixes”19 issues from the original Valitron library were addressed:
Security
Section titled “Security”- Hardened regex patterns against ReDoS attacks
- Validated paths in language file loading
- Replaced
rand()withrandom_int() - Enforced strict equality (
===) everywhere
Validation Rules
Section titled “Validation Rules”- Fixed integer regex pattern
- Fixed
instanceofimplementation - RFC 5321 compliant email validation with length limits
- Fixed slug regex pattern
- Improved date parsing and edge case handling
- Added credit card maximum length check
- Fixed array subset comparison logic
- Corrected ASCII validator return type
- Boolean now accepts string representations (
"true","false")
Modernization
Section titled “Modernization”- Fixed method name typos
- Added Unicode support in alpha validation
- Using
str_starts_with(),str_ends_with(),str_contains() - Replaced switch statements with match expressions
- Using array spread operator throughout
Infrastructure
Section titled “Infrastructure”- Updated composer.json to PHP 8.1+, PHPUnit 10, PHPStan
- Configured PHPStan level 8 static analysis
- Rewrote Validator.php (1882 lines) with strict types, typed properties, and type hints on all public methods
Upgrade Notes
Section titled “Upgrade Notes”Migrating from Valitron
Section titled “Migrating from Valitron”If you’re migrating from vlucas/valitron:
-
Namespace change
// Beforeuse Valitron\Validator;// Afteruse Frostybee\Valicomb\Validator; -
PHP version requirement
- Valicomb requires PHP 8.2+
- Update your
composer.jsonaccordingly
-
Strict types
- All code uses strict types
- Ensure your data types are correct
-
Deprecated methods
mapFieldRules()→ UseforFields()mapFieldsRules()→ UseforFields()mapOneFieldToRules()→ UseforFields()
Reporting Issues
Section titled “Reporting Issues”Found a bug? Have a feature request?
- GitHub Issues
- For security issues, please use GitHub’s private security advisory feature.