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

Can disallow attributes #183

Closed spaze closed 1 year ago

spaze commented 1 year ago

Can even re-allow them back with a config similar to re-allowing method calls.

This may be most useful in the following cases:

  1. You don't want to use some attributes in your project for whatever reason you may have
  2. You want to use attributes but only with some parameters specified, for example you'd like all Doctrine\ORM\Mapping\Entity attributes to have repositoryClass specified
  3. You want an attribute to be used only in some class

Attributes are available starting with PHP 8.0.

Close #179

spaze commented 1 year ago

image

ruudk commented 1 year ago

Thanks @spaze for this. Can't wait to try it out. Will it be tagged soon?

spaze commented 1 year ago

I have now released this in 2.13.0.