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 20, 2024
1 parent 606d3bc commit 3b1c32e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions 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]);

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
3 changes: 3 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@
<InvalidArgument>
<code><![CDATA[$object]]></code>
</InvalidArgument>
<InvalidArrayOffset>
<code><![CDATA[[$classMetadata->identifier => $identifier]]]></code>
</InvalidArrayOffset>
<InvalidCast>
<code><![CDATA[$autoGenerate]]></code>
</InvalidCast>
Expand Down

0 comments on commit 3b1c32e

Please sign in to comment.