Open verfriemelt-dot-org opened 1 month ago
i had no luck with that so far, maybe i use it wrong?
here is a simple example illustrating the problem:
https://github.com/verfriemelt-dot-org/phpstan-disallowed-calls-example
Thanks for the example repo. I get this when analyzing it
------ ------------------------------------------------------------------------------------------------------------
Line Example.php
------ ------------------------------------------------------------------------------------------------------------
21 Calling Doctrine\Persistence\ObjectRepository::findBy() (as App\Repository\VersionRepository::findBy()) is
forbidden, to not use magic find*() methods.
💡 add method to interface instead!
------ ------------------------------------------------------------------------------------------------------------
What do you expect PHPStan to report in the repo?
given a doctrine repository which looks like this:
i want to disallow magic methods like
$repo->findOneBy([ ... ])
which would work with:but this will also disallow the following method:
:thinking: is there an option or could an option be introduced, to limit the scope to only the parent class for that check?