Finch is code sniffing tool, with specific rules set you can check your code style and recieve report output. Finch emerged from need of one company to keep code style clean and same on every project, we didn't wanted to make bigger differences across projects.
The following rules are supported in this version, while we actively work on this project, many more will be supported in future. For example of some basic setup you can take a look at rules file.
-
Value can be from 0 to n, it checks for maximum chars for each line.
-
Check for use statements sort from shorter to longer regarding string length.
-
Forcing namespaces in files. No global scope is allowed.
-
Forbid usage of else if statements, if you use else if maybe its time for switch.
-
Forbids usage of else statement
-
Forbids usage of inline brackets, brackets for statements and declarations need to be in new line
-
Forbid usage of goto statement, are you some kind of dinosaur? Be carefull for raptor
-
Forbid usage of built in eval function.
-
Passing variables by ref is forbiden
-
Returning references is forbiden
-
Forbids usage of globals.
-
Force usage of spaces, using tabs is forbiden
-
Forbid usage of php file closing tag (?>) at the end of php files
-
Class names must follow StudlyCaps naming rules
-
Methods must follow camelCase naming rules
-
Detects usage of var_dump function