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 control structures like else, elseif, goto #257

Closed spaze closed 5 months ago

spaze commented 5 months ago

Checking params inside ( ... ) doesn't work at the moment, so you can disallow all declare()s but can't re-allow e.g. declare(strict-types = 1).

If you try to disallow else if with the space, an exception will be thrown, because else if is parsed as else followed by if, so disallowing else if with the space wouldn't have the desired effect and the result would be unexpected.

Close #68

spaze commented 5 months ago

Released in 3.3.0 now.