PHP_CodeSnifferPHP 代碼審查
PHP_CodeSniffer 對(duì) PHP 文件進(jìn)行標(biāo)記,并檢測(cè)違反一組定義的編碼標(biāo)準(zhǔn)的情況。
PHP_CodeSniffer 是一組兩個(gè) PHP 腳本:主腳本 phpcs 對(duì) PHP、JavaScript 和 CSS 文件進(jìn)行標(biāo)記,以檢測(cè)是否違反定義的編碼標(biāo)準(zhǔn);第二個(gè)腳本 phpcbf 自動(dòng)糾正違反編碼標(biāo)準(zhǔn)的行為。PHP_CodeSniffer 是一個(gè)重要的開(kāi)發(fā)工具,可以確保你的代碼保持干凈和一致。
PHP_CodeSniffer 要求 PHP 5.4.0 或更高版本。
# Download using curl
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
# Or download using wget
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
# Then test the downloaded PHARs
php phpcs.phar -h
php phpcbf.phar -h評(píng)論
圖片
表情
