PhpStromでphpcsの設定
1. phpcsインストール
Windows
の場合
composer は導入済みとする
|
> composer.bat global require "squizlabs/php_codesniffer=*" Changed current directory to C:/Users/foo/AppData/Roaming/Composer ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 0 updates, 0 removals - Installing squizlabs/php_codesniffer (3.3.0): Downloading (100%) Writing lock file Generating autoload files
場所の確認
> which phpcs C:\Users\foo\AppData\Roaming\Composer\vendor\bin\phpcs
2. phpstormの設定
図 1. Languages & Frameworks > PHP > Code Sniffer
図 2. Inspections
チェックを入れる
Cording standard
に PSR2
を選択