News Feed
Sections




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

Mayflower Blog:
Creating coding standards for PHP_CodeSniffer
February 25, 2011 @ 13:33:07

On the Mayflower blog today there's a new tutorial posted about creating coding standard "sniffs" for the PHP_CodeSniffer tool. A "sniff" is what defines the rules for your coding standards to follow (like "curly braces after function definitions should be on the next line" kinds of things).

In some cases the pre-installed coding standards like PEAR or Zend might not be sufficient for our current project or we want to deviate. This is the moment when we want to be able to create a custom one that fits our special needs. In this article I want to share my first experiences with you about how to create a custom coding standard for PHP_CodeSniffer.

They get into the details of what a "sniff" is and shows where they belong in the current structure of your PEAR install. There's an example of how to run the command line tool and how to create your own structure for your own custom sniffs. Their first example sniff checks to ensure that the first letter of a class is in uppercase.

0 comments voice your opinion now!
coding standard phpcodesniffer tutorial introduction


blog comments powered by Disqus

Similar Posts

PHPBuiilder.com: Using Get and Post Methodology in AJAX Applications

PHPMaster.com: Patterns for Flexible View Handling, Part 1 - Working with Composites

NETTUTS.com: Real-World OOP With PHP and MySQL

Giorgio Sironi's Blog: Practical PHP Patterns

ITNewb.com: PHP Encryption / Decryption Using the MCrypt Library (libmcrypt)


Community Events





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


opinion laravel podcast symfony security tool interview language composer list framework version series introduction library community artisanfiles voicesoftheelephpant conference release

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