Skip to content

Missing skip null fields #84

@camerpu

Description

@camerpu

Hi, I'd like to know why this overwriten function:

    protected function setDestinationValue(
        $destination,
        string $propertyName,
        $value
    ): void {
        $this->propertyWriter->setProperty(
            $destination,
            $propertyName,
            $value
        );
    }

In MapFrom.php
doesn't have this check from his parent:

        if ($value === null && $this->options->shouldIgnoreNullProperties()) {
            return;
        }

In this case, when I use mapToObject, it won't skip null fields even I configured it in options by:

            ->getOptions()
            ->ignoreNullProperties();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions