From 92fc8304e50cbaecb3cfc62c45c561458d48378f Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 2 Mar 2024 17:13:05 +0100 Subject: [PATCH 1/2] Refator array_map into simple loop. --- src/UnitOfWork.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 00698e56c60..c681f9e8550 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -1781,18 +1781,15 @@ public function addToIdentityMap($entity) */ 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, ); } From f637c4d888e88960fedeeccf648c106c26208914 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 2 Mar 2024 17:42:00 +0100 Subject: [PATCH 2/2] Housekeeping: PHP 7 compatibility --- src/UnitOfWork.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index c681f9e8550..0ccbb8ead5f 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -1789,7 +1789,7 @@ final public static function getIdHashByIdentifier(array $identifier): string return implode( ' ', - $identifier, + $identifier ); }