==================================
1. 代碼規范審查以及修正工具 - PHP_CodeSniffer
- 簡短說明
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
- 工具地址
https://github.com/squizlabs/PHP_CodeSniffer - 項目具體使用說明
檢測
phpcs --standard=PSR2 ./,遵循psr2代碼規范。 規范詳細內容請看這里:http://www.php-fig.org/psr/psr-2/
修復
phpcbf --standard=PSR2 *