Repository navigation
⚠️ Breaking changes
- A new encoder is strict by default.
new XmlEncoder($extractor)now 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. Anullstays empty and aStringableobject is written as its text in both modes. - Raised the PHP floor to
^8.4. PHP 8.3 is no longer supported. XmlEncoder::$nameConverteris private and read-only. It was protected. A subclass that read the property has to change.CamelCasePropertyNameConverteris a final read-only class. It can no longer be extended. ImplementPropertyNameConverterInterfaceinstead.
🔧 Internal
- Property hooks are read through the reflection API directly, the PHP 8.3 fallbacks are gone.
- A property with a stored value and a
gethook is pinned by a test, the encoder writes what the hook returns. - Copy-paste detection runs through the shared workflow, with jscpd pinned in
package.json. Runnpm cionce before the localci:test.
🧭 Migration
- To keep dropping an unmappable value silently, pass
falseas the third constructor argument:new XmlEncoder($extractor, $nameConverter, false). - Move to PHP 8.4 or newer.
- Replace a subclass of the converter by an implementation of the interface.
The 3.x line (PHP 8.3, lenient default) is maintained on the 3.x branch.