Closed michnovka closed 1 year ago
I am not sure if this is the proper fix tho. The error is complaining about Persistance interface. Any help please @orklah @weirdan ?
It seems to come from the Persistence\ObjectManagerInterface interface indeed. It would be this stub: https://github.com/psalm/psalm-plugin-doctrine/blob/62dd7fef85469c63739c0252c2d82151617921b5/stubs/ObjectManager.phpstub
However, we don't actually have a stub for refresh that would declare only one argument so a change here should not be needed. Unless they deployed some kind of migration path and Psalm would be confused about which signature it should take?
This is the way I autowire the $entityManager
.
class ResellerHelper
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
) {
}
so probably, I should fix the EntityManagerInterface
also, otherwise this autowiring will fail with psalm. This is btw the exact same approach that is used for the EntityManager#find
and EntityManagerInterface#find
and $lockMode
@orklah I have pushed new fix for both EntityManager
and EntityManagerInterface
stubs. Tested on my code and it does resolve the issue.
@orklah can we merge this please?
Thanks!
Thanks for merging. Can you please release at least a point release?
Fixes https://github.com/psalm/psalm-plugin-doctrine/issues/135