Skip to content

Disallow control structures like else, elseif, goto and others

Compare
Choose a tag to compare
@spaze spaze released this 04 May 17:02
· 37 commits to main since this release
d58806c
  • Can disallow control structures like else, elseif, goto (#257)

Checking params inside ( ... ) doesn't work at the moment, so you can disallow all declare() constructs 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. Disallow elseif, or don't write else if in your code 😇