Raise PHPStan level to 2
Under level 4 👺 viktor says: broken application/package (not polite)
Yes, many return types are interfaces, not concrete implementations. So: many methods are missing.
But there are exceptions 🤯 https://github.com/williarin/wordpress-interop/blob/b8e5fff62b045eb6df5de16c61819488f5d1ff3e/test/Test/Bridge/Repository/ShopOrderRepositoryTest.php#L15
Let me pull out my secret laser gun 🔫 https://github.com/williarin/wordpress-interop/blob/b8e5fff62b045eb6df5de16c61819488f5d1ff3e/test/Test/Bridge/Repository/TermRepositoryTest.php#L21-L22
Errors on Level 2 reduced from 140 to 51 🎉
Supporting RepositoryClass attribute: https://github.com/phpstan/phpstan/issues/9279
I do not know how to go on as there is no mechanism in PHPStan
getRepository(string $entityClassName): RepositoryInterface to find out the repository class from entity class.
... although one can write a tiny type specifying extension.
The above so called "PHPStan extension" finds out Repository names using str_replace :(
But reduces the number of problems to 38!
@williarin Could you help fixing remaining ones?