Repository navigation
3.2.0
Added
- Opt-in strict mode.
new XmlEncoder($extractor, $nameConverter, true)throwsUnmappableValueExceptionfor a value it cannot map instead of dropping it without a signal. The message names the property path and the type of the value. UnmappableValueException, aRuntimeExceptionwith named constructors for a value that is neither scalar norStringableand for a collection value that cannot be iterated.
The default stays lenient, so an existing encoder behaves exactly as before. A null stays empty and a Stringable object is written as its text in both modes.
Documentation
- The API reference and the recipes describe which values a lenient encoder drops and what a strict encoder does instead. This covers an unresolved array, a nested object without the marker interface, a marker on a collection and a collection converter that returns no iterable.