- PHP 8.4+ is now required (up from PHP >= 5.6 in the last released 2.x line).
- License changed from BSD to MIT.
- Removed
aura/installer-defaultfromcomposer.json. - Removed Aura.Di configuration files.
Filter::apply()no longer mutates$valuesby reference and no longer returnsbool. It now acceptsarray|objectby value and returns aFilterResultInterfacecontaining the success flag, the values, and aFailureCollectionInterface. See the upgrade guide for migration details.Fieldset::filter()andCollection::filter()now returnboolwith an explicit return-type declaration;getFailures()now returnsAura\Filter_Interface\FailuresInterface(typed).Collection::getFailures()now returns a flatFailuresInterfacekeyed with dot-notation paths (e.g."0.email") instead of a nested array.CollectionIteratormethods (current(),key(),next(),rewind(),valid()) now carry explicit return-type declarations; properties are typed.- All classes now declare
strict_types=1and use full PHP 8.x type declarations throughout. - Removed Aura.Di integration — no
config/directory or container configuration is shipped. aura/filter-interfacedependency updated todev-sub-filter(introducesFilterInterface,FilterResultInterface,FailureCollectionInterface,FailuresInterface,FailureInterface, andFilterResult).- CI moved from Travis CI to GitHub Actions; PHPUnit dependency changed from
yoast/phpunit-polyfillstophpunit/phpunit: ^11.0.
- ADD:
Filter\Failure— concreteFailureInterfaceimplementation for closure-based filter rules. Uses PHP 8 readonly constructor-promoted properties. ImplementsJsonSerializableviaFailureInterface. - ADD:
Filter\FailureCollection— implements the fullFailureCollectionInterface(both the write sideadd()/set()and the read sideforField()/forPath()/getMessages()/getNestedMessages()). Stores plain string messages; wraps them inFailurevalue objects on demand. - ADD:
FailureCollection::getNestedMessages()— reconstructs a nested array structure from flat dot-notation keys, mirroring the shape of the original input data. - ADD:
FailureCollection::forPath(string $path)— dot-notation path lookup returningFailureInterface[]. - ADD:
FailureCollection::isEmpty()— returnstruewhen no failures are recorded. - ADD:
Filter::apply()now returnsFilterResultInterface(aFilterResultvalue object) containingisSuccess(),getValues(), andgetFailures(). - ADD: PHP 8.2, 8.3, 8.4, and 8.5 support added to CI test matrix.
- ADD:
aura/filter-interfacepackage dependency introducingSubjectFilterInterface,FilterResultInterface,FilterResult, andFailureInterface.
- CHG:
Filter::setRule()andFilter::addRule()parameter types are nowstring $field,string $message,\Closure $closure(strict types). - CHG:
Filter::getMessages()parameter is now?string $field = null(typed); return type isarray. - CHG:
Filter::addMessages()parameter$messagesis nowstring|array(union type). - CHG:
Fieldset::filter()now consumesFilterResultInterfacefromFilter::apply()and aggregates nested fieldset/collection failures automatically using dot-notation prefixing. - CHG:
Fieldset::getFailures()return type is now declared asFailuresInterface. - CHG:
Collection::fill()return type is now declared asvoid. - CHG:
Collection::filter()return type is now declared asbool. - CHG:
Collection::getFailures()return type is now declared asFailuresInterface. - CHG: License header updated to MIT throughout all source files.
- DOC: README updated with PHP version requirements.
- Fixed addMessages behavior in Filter class, see #64
- Support for adding messages in closure rule, see #40
- New
isSuccessmethod, see #45 - Branch alias
dev-developremoved fromcomposer.json, see https://github.com/auraphp/Aura.Input/commit/02e125148dcb23813799f8fe0bb8a70d66706b45 - Tests are now running on 5.4, 5.5, 5.6, 7.0 and HHVM on travis-ci.
See the 1.x branch CHANGES.md for the full 1.x release history, including versions 1.0.0 through 1.2.1.