From ca448ae79255c21d9e5b7b4684133553aef20fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Mon, 9 Jan 2023 09:10:01 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Alexander M. Turek --- lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php | 2 +- lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php | 2 +- lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php index 3c01e120cab..86df5209054 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php +++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php @@ -115,7 +115,7 @@ public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform // Association defined as Id field $joinColumns = $class->associationMappings[$fieldName]['joinColumns']; $assocQuotedColumnNames = array_map( - static fn ($joinColumn) => isset($joinColumn['quoted']) + static fn (array $joinColumn) => isset($joinColumn['quoted']) ? $platform->quoteIdentifier($joinColumn['name']) : $joinColumn['name'], $joinColumns, diff --git a/lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php b/lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php index f4225dffccf..93680eee10f 100644 --- a/lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php +++ b/lib/Doctrine/ORM/Mapping/ReflectionEnumProperty.php @@ -54,7 +54,7 @@ public function setValue(mixed $object, mixed $value = null): void { if ($value !== null) { if (is_array($value)) { - $value = array_map(fn ($item): BackedEnum => $this->initializeEnumValue($object, $item), $value); + $value = array_map(fn (int|string|BackedEnum $item): BackedEnum => $this->initializeEnumValue($object, $item), $value); } else { $value = $this->initializeEnumValue($object, $value); } diff --git a/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php b/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php index fa51cfa8294..50bdf8a14c8 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/WhereInWalker.php @@ -148,7 +148,7 @@ private function convertWhereInIdentifiersToDatabaseValue(string $type): void $query->setParameter( self::PAGINATOR_ID_ALIAS, - array_map(static fn ($id): mixed => $connection->convertToDatabaseValue($id, $type), $identifiers), + array_map(static fn (mixed $id): mixed => $connection->convertToDatabaseValue($id, $type), $identifiers), ); } }