Releases: nette/schema
Releases · nette/schema
Release list
Released version 1.3.6
A round of fixes to the corners of the validation pipeline that only bite once your schema gets interesting: nullable arrays, invalid keys, deprecated items and anyOf() branches. On top of that, castTo() now speaks backed enums.
✨ New Features
- castTo() now accepts a backed enum –
Expect::string()->castTo(Status::class)converts the value viaStatus::from()and, when it doesn't match, reports a proper validation error listing all allowed cases instead of blowing up with aValueError. Pure (non-backed) enums are rejected up front with a clear message. - Casting to a class that can't swallow the given value no longer surfaces as a bare
Error– you get an InvalidStateException naming the target class, so you know what failed to be constructed.
🐛 Bug Fixes
- A
nullvalue for a nullable array is finally left asnull. Previously the "NEON can't tellnullfrom an empty array" workaround kicked in even for schemas explicitly declarednullable(), silently turning yournullinto[]. - Items with an invalid key are now dropped instead of being merged together – all failing keys used to collapse into a single
''entry, quietly overwriting each other's values. - Processor::getWarnings() no longer dies with an error when called before anything was processed; it simply returns an empty array.
deprecated()on a required structure no longer emits a warning when the item isn't present in the input at all – you only get warned about deprecated items you actually used.- anyOf() stopped losing information in the winning branch: dynamic parameters found inside are propagated to the outer context again (they used to be silently forgotten, so DI never validated them), and
skipDefaultsis now honored inside the branch. ADynamicParameterschema also no longer registers itself for deferred validation. - Error messages keep unknown
%placeholders%intact instead of tripping over an undefined index.
Released version 1.3.5
A code quality release that tightens static analysis and cleans up internals.
- Fixed all PHPStan errors and improved phpDoc annotations
- Switched to singleline
declarestatements across the codebase
Released version 1.3.3
- support for PHP 8.5
- optimized global function calls
Released version 1.3.2
Released version 1.3.0
- requires PHP 8.1
- uses PHP 8.1 features
Released version 1.2.5
Released version 1.2.4
- support for PHP 8.3
- constants are PascalCase
Released version 1.2.3
Released version 1.2.2
Released version 1.2.0
Structure::skipDefaults()allow to skip defaults per structureAnyOf()must not be empty- added
AnyOf::firstIsDefault() - Ability to define scheme for the key
Expert::arrayOf($stringType, $keyType)