bmitch / Codor

Custom PHPCS sniffs to find Code Smells

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sniff to prevent if/loops within any controller methods?

bmitch opened this issue · comments

Not sure if this is a good idea or not but I guess users can always disable if they don't want to use it.

If the file ends in Controller.php then no methods within should contain any logic. Logic should be delegated to other classes.

  • If file ends in controller.
  • If file contains if, else, or any loop keyword it fails.