Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support class bann rules #31

Open
staabm opened this issue Mar 7, 2020 · 2 comments
Open

Support class bann rules #31

staabm opened this issue Mar 7, 2020 · 2 comments

Comments

@staabm
Copy link

staabm commented Mar 7, 2020

Would be great if one could also ban single classes or even namespaces.

This is especially usefull when you wanne get rid of a external dependency in which you cannot annotate the classes itself with @deprecated as you dont own the code

If already supported: a example in the readme would be great

@alister
Copy link

alister commented Feb 18, 2021

I can see the benefits of this, such as if it would detect even just use imports. I'm working on a codebase where people still end up adding use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; though it (and other similar) classes/annotations have been deprecated for a while.

follow-up: It appears that spaze/phpstan-disallowed-calls#51 may be able to support this

@ruudk
Copy link

ruudk commented Feb 20, 2021

Please try https://github.com/spaze/phpstan-disallowed-calls/tree/v1.3.0 as it supports this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants