diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 5c16c511ce1..e1336140640 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -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, ); }