Skip to content

v2.0.0

Choose a tag to compare

@antfroger antfroger released this 10 Sep 14:23
· 1 commit to main since this release
5de1aca

What's Changed

⚠️ Breaking Changes

  • PHP >= 8.2 is now required (was ^8.1). PHP 8.1 reaches end of life on
    December 31, 2025.
  • RuleInterface::decide() signature changed to
    decide(ParameterBagInterface $bag, mixed $params = null): bool.
    Implementations receiving extra custom optional parameters (or variadics)
    must be updated to accept the feature's config value as a single mixed
    argument. The value received is unchanged: the raw value declared in the
    feature's configuration.
  • Rule classes (Enabled, Partial, Unanimous, Custom) are now
    final readonly and cannot be extended.
  • The Progressive class is now final.
  • Store::addCustom() stores rules as Closure. It still accepts any
    callable in input, but a TypeError may surface where a callable was
    previously kept as-is.

Added

  • Native type declarations, readonly classes and constructor property
    promotion throughout the library
  • PHPStan level 8 analysis, including checked-exception validation of the
    public API (@throws annotations)
  • autoload-dev PSR-4 mapping for tests

Changed

  • Test suite upgraded from PHPUnit 9 to PHPUnit 11:
    • test metadata migrated from docblocks to attributes (#[DataProvider])
    • data providers are now static, generator-based functions with named keys
  • php-cs-fixer ruleset refreshed

Fixed

  • Misleading @throws annotations in ParameterBagInterface (documented
    LogicException where ParameterNotFoundException is actually thrown)
  • Typo in StoreInterface::addCustom() PHPDoc

Full Changelog: v1.2.2...v2.0.0