Skip to content

Change or new Feature #49

Description

@pine3ree

I was wondering why the DateTimeFormatterStrategy allows the empty string during hydration:

if ($value === '' || $value === null || $value instanceof DateTimeInterface) {

Since we are hydrating a DateTime|null property, shouldn't we hydrate an empty datetime string with null?
Or we could add a constructor option to let the developer choose in those cases (private $hydrateEmptyStringToNull = false; to avoid BC)

kind regards

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions