Skip to content

Commit

Permalink
fix: only remove source property mapping if it maps to the same name …
Browse files Browse the repository at this point in the history
…on the target side (#240)
  • Loading branch information
priyadi authored Oct 16, 2024
1 parent 20195b1 commit a9e4a19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 1.13.0

* feat: `Map(property: null)` ignores the mapping
* fix: only remove source property mapping if it maps to the same name on the
target side

## 1.12.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class: $sourceClass,
}

if ($targetProperty === null) {
if (isset($targetPropertyToSourceProperty[$sourceProperty])) {
if (($targetPropertyToSourceProperty[$sourceProperty] ?? null) === $sourceProperty) {
unset($targetPropertyToSourceProperty[$sourceProperty]);
}

Expand Down

0 comments on commit a9e4a19

Please sign in to comment.