Skip to content

Commit

Permalink
To fix LM-Commons#51
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Richer [email protected] <[email protected]>
  • Loading branch information
visto9259 committed Jun 26, 2024
1 parent fc5d711 commit 278ef46
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Mapper/UserHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ public function hydrate(array $data, $object)
}

/**
* @param string $keyFrom
* @param string $keyTo
* @param string $keyFrom
* @param string $keyTo
* @param array $array
* @return array
*/
protected function mapField($keyFrom, $keyTo, array $array)
protected function mapField(string $keyFrom, string $keyTo, array $array): array
{
$array[$keyTo] = $array[$keyFrom];
unset($array[$keyFrom]);
if (isset($array[$keyFrom])) {
$array[$keyTo] = $array[$keyFrom];
unset($array[$keyFrom]);
}

return $array;
}
Expand Down

0 comments on commit 278ef46

Please sign in to comment.