==================================
1. 代碼規(guī)范審查以及修正工具 - PHP_CodeSniffer
- 簡(jiǎn)短說(shuō)明
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 - 項(xiàng)目具體使用說(shuō)明
檢測(cè)
phpcs --standard=PSR2 ./呐萌,遵循psr2代碼規(guī)范。 規(guī)范詳細(xì)內(nèi)容請(qǐng)看這里:http://www.php-fig.org/psr/psr-2/
修復(fù)
phpcbf --standard=PSR2 *