Skip to content

Commit d409833

Browse files
committed
Fixed PHPStan issue with generic repository in closure
1 parent 4b5bc9e commit d409833

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/batch-doctrine-persistence/src/ObjectRegistry.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public function findOneBy(string $class, array $criteria): ?object
3939
{
4040
return $this->findOneUsing(
4141
$class,
42-
fn(ObjectRepository $repository) => $repository->findOneBy($criteria),
42+
function ($repository) use ($criteria) {
43+
/** @var ObjectRepository<T> $repository */
44+
45+
return $repository->findOneBy($criteria);
46+
},
4347
serialize($criteria)
4448
);
4549
}

0 commit comments

Comments
 (0)