すぐに忘れる phpcs を設定する際に使うコマンド


※phpcsにpathが通っている前提です。

現在使用可能な規約

$ phpcs -i
The installed coding standards are PEAR, Zend, PSR2, MySource, Squiz, PSR1 and PSR12

自作ルールの格納ディレクトリを確認

$ phpcs --config-show
Using config file: /Users/hoge/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.conf

installed_paths: /Users/hoge/.phpcs
# installed_paths: 〜 が自作ルールを入れるフォルダ。

自作ルールの格納ディレクトリを指定

# installed_pathsは上書きされるので注意。(この場合 /Users/hoge/.phpcs の指定が消える。)
$ phpcs --config-set intalled_paths path/to/standarts/dir