我檢查這個PHP質量控制工具:PHP_CodeSnifferPHP編碼標準
在其文檔頁面例部分,它顯示了該工具的使用方法:
$ phpcs /path/to/code/myfile.php
FILE: /path/to/code/myfile.php
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
20 | ERROR | PHP keywords must be lowercase; expected "false" but found "FALSE"
47 | ERROR | Line not indented correctly; expected 4 spaces but found 1
51 | ERROR | Missing function doc comment
88 | ERROR | Line not indented correctly; expected 9 spaces but found 6
--------------------------------------------------------------------------------
上線
根據PHP的文檔20 |錯誤| PHP關鍵字必須小寫;預計「假」但發現「假」,我的問題是爲什麼小寫「假」和「真」。
:"A boolean expresses a truth value. It can be either TRUE or FALSE"
我想知道一個工具,選擇只報告最小的煩惱作爲'錯誤'... – sarnold