Using PHP_CodeSniffer

There’s many ways to install PHP_CodeSniffer.
You could try (on debian-base) apt-get install php-codesniffer – or if you have pear installed you could try pear install PHP_CodeSniffer. Or lastly, the way I like to do it, manually.

I like to perform a manual installation on tools like this so I know where to find them and manipulate them in the future.

Manual install:

Next, you need to replace the php_bin path in the phpcs file with the path to the php binary:

Test it out with:
./phpcs /path/to/some/phpfile.php

Now to finalize the install, there’s many places you could place the binary, I personally prefer to camp the working files like this in /usr/local/bin

No Comments

Start the ball rolling by posting a comment on this article!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">