"namespace-max-files": false,
Avoid namespaces with 15+ files:
"namespace-max-files": 15
Avoid overriding of a function's arguments:
"argument-override": {
"allow-pass-by-reference": true,
},
Avoid files with more than 200 lines:
"file-max-size": {
"max-lines": 200,
"include-comments": true,
"include-empty-lines": true,
"include-brackets": true
},
Avoid empty catch blocks:
"empty-catch": true
Avoid a class without a single comment at the top stating purpose:
"class-comment": true
Avoid dangerous calls to eval
, print_r
, var_export
, var_dump
, phpinfo
, exec
, ... (forbidden function list):
"forbidden-functions": [
"eval", "print_r", "var_export", "var_dump", "phpinfo", "exec"
],
Avoid an if statement or for loop without braces:
"missing-braces": true,
Avoid variables with names shorter than 3 letters (while whitelisting $i or $id)
"variable-length": {
"min-length": 3,
"whitelist": ["$id", "$i"]
}
Avoid any function longer than 50 lines:
"function-max-size": 50,
Aavoid loops with inside of them more than 15 lines (a block that should be a function):
"loop-max-size": 15,
Avoid function names starting with a certain pattern:
"forbidden-function-prefix": ["check"],
Avoid assignment inside of an if statement:
"if-assigment": true,
Avoid complicated ifs (eg more than 2 &&
, combination of &&
and ||
):
"complex-if": true,
Avoid ternary operator combined with line length exceeding 50 chars:
"ternary-max-length": 50,
Avoid triple inner for/foreach (eg for within for within for loop):
"loop-max-nest": 2,
Avoid indent deeper than 4 (maximum block nesting, eg for loop within an if within a for loop within a for loop):
"max-nest": 3,