Skip to content

3.2.0

Choose a tag to compare

@magicsunday magicsunday released this 05 Oct 07:05
· 6 commits to main since this release
3.2.0
a789fbb

Added

  • Opt-in strict mode. new XmlEncoder($extractor, $nameConverter, true) throws UnmappableValueException for 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, a RuntimeException with named constructors for a value that is neither scalar nor Stringable and 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.