Skip to content

Commit

Permalink
Remove unused var
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Oct 19, 2024
1 parent 606d3bc commit 735cb9a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);

Check failure on line 179 in lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php

View workflow job for this annotation

GitHub Actions / Static Analysis with Psalm (8.2)

InvalidArrayOffset

lib/Doctrine/ODM/MongoDB/Proxy/ProxyFactory.php:179:42: InvalidArrayOffset: Cannot create offset of type null|string, expecting array-key (see https://psalm.dev/115)

if ($original === null) {
throw DocumentNotFoundException::documentNotFound(
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 735cb9a

Please sign in to comment.