Skip to content

Commit

Permalink
Merge pull request #85 from visto9259/fix_51
Browse files Browse the repository at this point in the history
To fix #51
  • Loading branch information
visto9259 authored Jun 26, 2024
2 parents fc5d711 + 278ef46 commit e967e85
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 e967e85

Please sign in to comment.