Skip to content

Commit

Permalink
Merge branch '2.19.x' into 3.1.x
Browse files Browse the repository at this point in the history
* 2.19.x:
  Refator array_map into simple loop for performance. (doctrine#11332)
  • Loading branch information
derrabus committed Mar 3, 2024
2 parents ba0ea89 + e62571c commit 507c73c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -1557,18 +1557,15 @@ public function addToIdentityMap(object $entity): bool
*/
final public static function getIdHashByIdentifier(array $identifier): string
{
foreach ($identifier as $k => $value) {
if ($value instanceof BackedEnum) {
$identifier[$k] = $value->value;
}
}

return implode(
' ',
array_map(
static function ($value) {
if ($value instanceof BackedEnum) {
return $value->value;
}

return $value;
},
$identifier,
),
$identifier,
);
}

Expand Down

0 comments on commit 507c73c

Please sign in to comment.