Skip to content

Release 1.15

Choose a tag to compare

@igorpocta igorpocta released this 28 Oct 09:07

What's Changed

New Features

  • Partial updates (PATCH): sent vs. not sent — DTOs implementing ProvidedFieldsInterface (use the
    ProvidedFields trait) get the names of the properties present in the input: $dto->isProvided('note') is
    true also when note was sent as null, so "clear the value" can be told apart from "not sent". Tracked by PHP
    property name (renamed keys, paths, promoted constructor parameters), per nested object / array element, and
    extended by merge(). The tracking is excluded from mapping (never serialized, not hydratable, unknown in strict
    mode). Classes not implementing the interface are unaffected.

Bug Fixes

  • A missing nullable property without a default stayed uninitialized — public ?string $note; not present in the
    input was left uninitialized, so the first read failed with Error: must not be accessed before initialization
    (HTTP 500). It is now set to null, like a nullable constructor parameter already was. If such a property carries
    validators, they now validate null instead of reporting "This field is required.".