Friday, 17 August 2007

Getting the Zend coding standard into PHP_CodeSniffer

With the help of some sniffs contributed by Johann-Peter Hartmann, I've started creating a Zend coding standard for PHP_CodeSniffer, a commonly requested addition to the tool. This new standard implements the Zend Framework coding standards document and is currently available in CVS.

The standard is not yet complete, but it is on the way. I'll continue adding more sniffs as I get time. If you use the Zend coding standard and want to contribute, let me know.

2 comments:

Giorgio said...

I used phpcs in my zend framework project and it is a nice piece of work. However, I've opened a bug for switch statement sniffing, since the Zend convention is different from the Pear one:
https://pear.php.net/bugs/bug.php?id=14172

Greg Sherwood said...

I don't maintain that coding standard any more (this post is from 2007). Their coding standards have changed since then and this Zend standard in PHPCS should not be considered the same as the Zend Framework coding standards.

If anyone is interested in helping get them going, please let me know, although I think someone closely involved with the framework may already be working on it but is not contributing them back. It might be worth checking on the ZF site to see if they are available for download yet.