spaze / phpstan-disallowed-calls

PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages
MIT License
255 stars 17 forks source link

Method calls from interface implementations are not detected #212

Closed enumag closed 1 year ago

enumag commented 1 year ago

Similar case as my old PR (https://github.com/spaze/phpstan-disallowed-calls/pull/26) but for interfaces.

Same as before I just added a failing test case. I didn't look for the underlying issue.


Use case: After running into https://github.com/guzzle/psr7/issues/569 I wanted to disallow Psr\Http\Message\StreamInterface::getContents() but looks like this isn't supported yet.

spaze commented 1 year ago

Thanks, yeah, this isn't supported yet. But I guess it should be, it's already supported for constructors so you'd expect it to be supported for method calls as well.

spaze commented 1 year ago

Similar to

enumag commented 1 year ago

Oh, you fixed it already. Thanks! I tried it on my side and it detects the case I need correctly now. Do you want to do something else before tagging a release? :)

spaze commented 1 year ago

Yeah, wanted to sleep a bit 😅 This has now been released in 2.16.0, thanks for the help!

enumag commented 1 year ago

:laughing: Thanks!