News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Blue Parabola Blog:
Coding Standard Analysis using PHP_CodeSniffer
March 17, 2009 @ 07:57:47

Over on the Blue Parabola blog Matthew Turland recently posted a new tutorial on using the PHP_CodeSniffer PEAR package to check out how well your code adheres to the coding standard of your choice.

For the sake of consistency [on a client project], the development team had stuff with the coding standard used by the framework itself. However, evaluating the code manually is tedious and time-consuming. There's a solution to this type of problem: the PHP_CodeSniffer package from PEAR, which builds an infrastructure around tokenizers for PHP, CSS, and JavaScript and utilities to detect coding standard violations within code in any of those languages.

He includes an example token output (the codesniffer package is based on the Tokenizer) from a script and walks you through the initial setup of the package, how to create "sniffs" for the code you want to analyze and how to run them using the popular unit testing tool PHPUnit.

0 comments voice your opinion now!
phpcodesniffer sniff coding standard kohana analyze pear phpunit


blog comments powered by Disqus

Similar Posts

International PHP Magazine: Poll Question: What Is the Main Hindrance for PHP 5 to Get Adopted?

Community News: Latest PEAR Releases for 12.11.2006

Volker Dusch's Blog: How i judge frameworks - Or: Let me code in peace

Kore Nordmann's Blog: Installing cairo_wrapper on Gentoo

Greg Beaver's Blog: Pyrus, PEAR2 and web code coverage report for phpt-based tests


Community Events





Don't see your event here?
Let us know!


tips podcast community interview opinion library install list language framework laravel introduction voicesoftheelephpant symfony release bugfix deployment series api package

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework