I've just uploaded PHP_CodeSniffer version 1.0.1, which contains 6 bug fixes and adds some new sniffs into the Squiz and MySource standards after some lobbying by the MySource4 team. The coding standard we use for MySource4 now has 94 different sniffs, each containing up to 5 different checks, so it is getting fairly strict. The code should be pretty enough to frame and stick on your wall!
One important change has been made to the PEAR standard in this release. A recent RFC that asked PEAR developers to vote on forcing protected member vars to be prefixed with an underscore got me looking for the relevant sniff in PHP_CodeSniffer. (I didn't see the call for votes, but I would have voted not to prefix protected vars with an underscore.) While PEAR decided against adding this new standard, I did realise that PHP_CodeSniffer was not currently enforcing the existing standard. The 1.0.1 release adds a new sniff to the PEAR standard to ensure only private members vars are prefixed with an underscore.
You can view the full changelog, and download the release, on the package download page.
Monday, 4 February 2008
PHP_CodeSniffer 1.0.1 released
Posted by
Greg Sherwood
at
10:04 am
Tags: MySource4, PHP_CodeSniffer
Subscribe to:
Post Comments (Atom)

2 comments:
Hello,
I just tried your PHP_CodeSniffer and am really liking it!
I do have on bug in the NonExecutableCode Sniff in Squiz. I keep on getting undefined index: scope_condition on line 126. I check the array, scope_condition is not set, rather it is an array. Any ideas how I can fix this?
Thanks, Jan
Hi Jan,
If you have a small-ish piece of code you can replicate this error on, please submit a bug report on the PEAR package page and I will take a look at it.
http://pear.php.net/package/PHP_CodeSniffer
Post a Comment