diff --git a/src/EntityManager.php b/src/EntityManager.php index 79c18f4..7d512a2 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -34,7 +34,7 @@ public function getWrappedEm() : EntityManagerInterface /** @psalm-var EntityManagerInterface */ $context[self::class] = ($this->emCreatorFn)(); /** @psalm-suppress MixedMethodCall */ - Co::defer(function () use ($context) { + Co::defer(static function () use ($context) { $context[self::class]->close(); unset($context[self::class]); });