You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since version 3.4.6 psalm throws an error ImplementedReturnTypeMismatch when using Doctrine. The error occurs on the find method of any Doctrine Repository.
The exact error is: For privacy reasons the Repository is renamed to Foo.
ERROR: ImplementedReturnTypeMismatch - src/Repository/FooRepository.php:9:12 - The return type 'null|T as mixed' for Doctrine\Common\Persistence\ObjectRepository::find is different to the implemented return type for Doctrine\ORM\EntityRepository::find 'null|App\Entity\Foo'
I've validated if it's happening since this version by fixing the version to 3.4.5 and this error doesn't occur. When going to version 3.4.6 or any version higher, the error occurs.
The repository is just a simple repository generated from the maker-bundle command. But for any reference, here it is:
cc @weirdan, as it involves your plugin (but you did nothing wrong). You may also want to stub out Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository with something like
/** * @template T * @template-extends EntityRepository<T> */classServiceEntityRepositoryextendsEntityRepository {
}
to allow people to use @template-extends<Foo> in their repo files
Since version
3.4.6
psalm throws an errorImplementedReturnTypeMismatch
when using Doctrine. The error occurs on thefind
method of any Doctrine Repository.The exact error is:
For privacy reasons the Repository is renamed to
Foo
.I've validated if it's happening since this version by fixing the version to
3.4.5
and this error doesn't occur. When going to version3.4.6
or any version higher, the error occurs.The repository is just a simple repository generated from the maker-bundle command. But for any reference, here it is:
The error occurs on the line:
The text was updated successfully, but these errors were encountered: