Tuesday 20 February 2007

PHP_CodeSniffer 0.4.0 (beta) released

I released version 0.4.0 of PHP_CodeSniffer yesterday. Version 0.4.0 is mainly a bug-fix release. All but one of the bugs found were in the Squiz coding standards, which is not surprising as they are the newest standards and are being used by the MySource 4.0 team on a daily basis.

There are two minor new features in version 0.4.0 also.

The first is the wrapping of the error and warning messages in PHP_CodeSniffer's output. I wrote about that feature here.

The other change allows for coding standard names to be specified in whatever case you desire. Previously, PHP_CodeSniffer required the case of the supplied standard name and the standard directory to match exactly. Now, everything is compared in lowercase, so it doesn't matter how you specify it. For example, all these commands will check the file testfile.php against the PEAR coding standards:

phpcs --standard=PEAR testfile.php
phpcs --standard=Pear testfile.php
phpcs --standard=pear testfile.php
phpcs --standard=pEaR testfile.php
You can view the full changelog and download the release here.