From 3b1c32edf57791a6bf27d02135494c24f67dfc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Sat, 19 Oct 2024 04:22:21 +0200 Subject: [PATCH] Remove unused var --- lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php | 4 +--- psalm-baseline.xml | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php b/lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php index ef2bc9190..145edaf53 100644 --- a/lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php @@ -17,7 +17,6 @@ use Symfony\Component\VarExporter\ProxyHelper; use function array_combine; -use function array_flip; use function bin2hex; use function chmod; use function class_exists; @@ -177,7 +176,7 @@ protected function skipClass(ClassMetadata $metadata): bool private function createLazyInitializer(ClassMetadata $classMetadata, DocumentPersister $persister): Closure { return static function (InternalProxy $proxy, mixed $identifier) use ($persister, $classMetadata): void { - $original = $persister->load(['_id' => $identifier]); + $original = $persister->load([$classMetadata->identifier => $identifier]); if ($original === null) { throw DocumentNotFoundException::documentNotFound( @@ -214,7 +213,6 @@ private function getProxyFactory(string $className): Closure { $skippedProperties = []; $class = $this->dm->getClassMetadata($className); - $identifiers = array_flip($class->getIdentifierFieldNames()); $filter = ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PROTECTED | ReflectionProperty::IS_PRIVATE; $reflector = $class->getReflectionClass(); diff --git a/psalm-baseline.xml b/psalm-baseline.xml index d438ddf75..0363b8b0b 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -164,6 +164,9 @@ + + identifier => $identifier]]]> +