PHP_CodeSnifferでコーディング規約にあっているかチェックしてみる。PHP_CodeSnifferでは、MySource, Squiz, Zend, PEARおよびPHPCSの5種類の規約があらかじめ用意されている。 準備 Phingは2.4以上をインストールする。 PHP_CodeSnifferをインストールする。 Checkstyle Pluginをインストールする。 たくさん警告が出る場合メモリが足らなくなるので、php.iniのmemory_limitを大きい値に変えておく。Hudson用にもヒープを多めに設定しておく。 build.xmlの作成 build.xmlに次のタスクを追加する。 <target name="phpcs"> <phpcodesniffer standard="PEAR"> // PEAR形式でチェック <fileset dir="src"> /
![HudsonでPHPメモ(2) PHP_CodeSnifferでコーディング規約チェック - ssogabeの日記](https://cdn-ak-scissors.b.st-hatena.com/image/square/075745784a7ceb1aecd985e53003073af52d1f8e/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fs%2Fssogabe%2F20101010%2F20101010161215.png)