LoginSignup
4
5

More than 5 years have passed since last update.

How to check coding style by PHP CodeSniffer

Posted at

1) Install phpcs by cloning from git repository:

git clone git://github.com/squizlabs/PHP_CodeSniffer.git

2) Make symbolic link to phpcs:

cd PHP_CodeSiniffer
ln -s "$(pwd)/scripts/phpcs" ~/bin/phpcs

3) Now, try dumping help messages:

phpcs -h

4) Sniff codes:

phpcs --standard=PSR2 /path/to/codes

Then, you will see warnings for about violating conding starnd PSR2 :)

By the way, what is Qiita?

Visit Qiita and Kobito - Great Duet to manage your knowledge. ;)

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5