Skip to content

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.


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
  • mapOneFieldToRules() → Use forFields() instead
  • mapFieldRules() → Use forFields() instead
  • mapFieldsRules() → Use forFields() instead
  • Resolved multiple issues from the original Valitron library

  • Documentation website using Astro Starlight
  • Strict mode for stricter validation behavior
  • Inline custom messages support for per-rule error messages
  • New validation rules:
    • urlStrict for URL validation with required scheme
    • uuid with support for versions 1-5
    • startsWith and endsWith for string prefix/suffix validation
    • decimalPlaces for controlling decimal precision
    • positive for strictly positive numbers
    • past and future for date validation
    • phone with support for 12 countries
    • requiredWith / requiredWithout for conditional validation
    • IPv4 / IPv6 / ASCII for network and character validation
    • arrayHasKeys for required array keys
  • Case-insensitive option for string matching rules

Complete rewrite of the Valitron validation library for modern PHP.

  • PHP 8.2+ with strict types throughout
  • Zero dependencies (only ext-mbstring required)
  • Automatic ReDoS pattern detection
  • RFC 5321 email validation with length limits
  • PHPStan Level 8 compliance
  • PSR-12 code style
  • 430+ tests
  • 33 language translations
  • Extracted core classes (ErrorManager, LanguageManager, RuleRegistry)
  • Organized validation rules into trait files
  • Clean separation of concerns
  • numeric rule now properly handles scientific notation (e.g., 1.2e3)
  • Strict equality comparisons (no type juggling)
  • Path traversal protection in language loading

19 issues from the original Valitron library were addressed:

  • Hardened regex patterns against ReDoS attacks
  • Validated paths in language file loading
  • Replaced rand() with random_int()
  • Enforced strict equality (===) everywhere
  • Fixed integer regex pattern
  • Fixed instanceof implementation
  • 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")
  • 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
  • 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

If you’re migrating from vlucas/valitron:

  1. Namespace change

    // Before
    use Valitron\Validator;
    // After
    use Frostybee\Valicomb\Validator;
  2. PHP version requirement

    • Valicomb requires PHP 8.2+
    • Update your composer.json accordingly
  3. Strict types

    • All code uses strict types
    • Ensure your data types are correct
  4. Deprecated methods

    • mapFieldRules() → Use forFields()
    • mapFieldsRules() → Use forFields()
    • mapOneFieldToRules() → Use forFields()

Found a bug? Have a feature request?

  • GitHub Issues
  • For security issues, please use GitHub’s private security advisory feature.