Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Setting up Codesniffer

Jones edited this page Apr 21, 2015 · 2 revisions

Get Codesniffer

Download phpcs.phar and phpbf.phar and save both files in your project root.

Get the standard

Get the latest version from github and save it in a new folder named MyBB2 in your project root. Either clone it via git or download it.

Running Codesniffer

Now simply run php phpcs.phar in your project root to sniff all files. You can get a summary of listed errors by adding --report=summary. While phpcs only runs the sniffs on the code you can also use phpbf instead which will also fix some of the issues (eg tabs and spaces).

Set up Git Hook

(TO BE TESTED): https://github.com/squizlabs/PHP_CodeSniffer/issues/456