<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 12 Feb 2012 21:17:19 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHP_CodeSniffer]]></title>
      <guid>http://www.phpdeveloper.org/news/16600</guid>
      <link>http://www.phpdeveloper.org/news/16600</link>
      <description><![CDATA[<p>
<i>Michelangelo van Dam</i> has posted the next part in his "QA in PHP development" series to his blog, <a href="http://www.dragonbe.com/2011/07/quality-assurance-on-php-projects_17.html">a look at PHP_CodeSniffer</a>, a tool that can be used to keep the coding standards of your application in line.
</p>
<blockquote>
<a href="http://pear.php.net/manual/en/package.php.php-codesniffer.php">PHP_CodeSniffer</a> is probably the most convenient tool out there to analyze your source code and to verify it complies to company policies. Although it's debatable why source code should follow strict guidelines, it's only a matter of time before you discover yourself that it pays off to have a code base that appears to be written by one developer.
</blockquote>
<p>
He talks about how it works to keep every brace in the right place and format the same through out all of your files. He also mentions that its standards are flexible and can be modified as you might see fit. He looks at the installation process (both manual and through the PEAR installer) and how to use it to analyze your codebase. He's even included a short screencast <a href="http://www.dragonbe.com/2011/07/quality-assurance-on-php-projects_17.html">in the post</a> so you can see the results first-hand.
</p>]]></description>
      <pubDate>Mon, 18 Jul 2011 09:06:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christian Weiske's Blog: How to integrate PHP_CodeSniffer with Git repositories?]]></title>
      <guid>http://www.phpdeveloper.org/news/16393</guid>
      <link>http://www.phpdeveloper.org/news/16393</link>
      <description><![CDATA[<p>
<i>Christian Weiske</i> has a problem he hopes you can help with - he's trying to get the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_Codesniffer</a> tool integrated into his git workflow (well, the workflow of his team) as an automatic process that runs on commit. Unfortunately he's <a href="http://cweiske.de/tagebuch/codesniffer-git-how.htm">having some issues</a>.
</p>
<blockquote>
At work, we used a SVN server and enforced our project coding standard with a pre-commit hook on the server that ran PHP_CodeSniffer. Whenever a developer tried to commit some code that does not match the standard, he got it rejected. [...] The only way to enforce the standard is a pre-receive hook on our central Git repository server that all devs push to. Just installing the SVN hook on it isn't the solution, though.
</blockquote>
<p>
Because of how git handles commits (possibly multiple in one push) the usual methods won't work. Other tricky things like file renaming and allowing for legacy code check-ins are also needed. He's <a href="http://stackoverflow.com/questions/6120331/git-pre-receive-hook-with-php-codesniffer">posted the question on StackOverflow</a> too, but no one's come up with a good answer yet (at the time of this post).
</p>]]></description>
      <pubDate>Fri, 27 May 2011 11:16:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Volker Dusch's Blog: Please ship your own coding standard as part of your project]]></title>
      <guid>http://www.phpdeveloper.org/news/16039</guid>
      <link>http://www.phpdeveloper.org/news/16039</link>
      <description><![CDATA[<p>
<i>Volker Dusch</i> has a suggestion for all of the PHP projects (or, really Open Source projects in general) that can help keep things cleaner in your codebase and make for simpler times when merging contributions - <a href="http://edorian.posterous.com/please-ship-your-own-coding-standard-as-part">including your coding standard</a> along with the rest of your project.
</p>
<blockquote>
Let me elaborate on [an important] point: Contribution. Most developers i know care about producing good code, especially then they are contributing to an open source project! Those people will respect your coding standard, naming scheme and every thing else that they can check for before sending you all patch/pull request. So try to make that part easy.
</blockquote>
<p>
He talks about doing things the hard way - reformatting everything by hand each time someone contributes - or the easier way of enforcing the coding standard as a part of the contribution flow. He mentions <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.intro.php">PHP_CodeSniffer</a> and the <a href="http://phpmd.org/">PHP Mess Detector</a> as a part of a Jenkins installation (easily built from <a href="http://jenkins-php.org/">this handy project</a>). 
</p>]]></description>
      <pubDate>Mon, 14 Mar 2011 11:32:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mayflower Blog: Creating coding standards for PHP_CodeSniffer]]></title>
      <guid>http://www.phpdeveloper.org/news/15966</guid>
      <link>http://www.phpdeveloper.org/news/15966</link>
      <description><![CDATA[<p>
On the Mayflower blog today there's a new tutorial posted about <a href="http://blog.mayflower.de/archives/631-Creating-coding-standards-for-PHP_CodeSniffer.html">creating coding standard "sniffs"</a> 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).
</p>
<blockquote>
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.
</blockquote>
<p>
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. 
</p>]]></description>
      <pubDate>Fri, 25 Feb 2011 13:33:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Wim Godden's Blog: Automated PHP 5.3 compatibility testing for your (old) code]]></title>
      <guid>http://www.phpdeveloper.org/news/15616</guid>
      <link>http://www.phpdeveloper.org/news/15616</link>
      <description><![CDATA[<p>
In <a href="http://techblog.wimgodden.be/2010/06/24/automated-php-5-3-compatibility-testing-for-your-old-code/">this new post</a> to his blog today, <i>Wim Godden</i> looks at how you can use the <a href="http://phpunit.de">PHPUnit</a> unit testing framework to be sure your applications are ready to move to a PHP 5.30-only world.
</p>
<blockquote>
So you or your team has built anywhere between 5 and 500 projects in PHP 4, 5.1 and 5.2 over the past 5 years. And now PHP 5.3 is there, offering a lot of very interesting features, including namespace support,  late static binding (finally !), closures, nested exceptions and a bunch more (see the <a href="http://be2.php.net/manual/en/migration53.new-features.php">new feature list</a>). So naturally, you'd like to upgrade. But doing so might break some old code. 
</blockquote>
<p>
He suggests a few different options - just run your unit tests and hope for the best, test the application's code directly or, his preference, run compatibility tests with the help of <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> and <a href="http://github.com/wimg/PHP53Compat_CodeSniffer/downloads">this new sniff</a> he created. The sniff finds things like deprecated functions hanging around from pre-5.3 times as a part of a subset that the code sniffer can easily find.
</p>]]></description>
      <pubDate>Wed, 22 Dec 2010 09:02:10 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Enforcing Coding Standards with PHP_CodeSniffer ]]></title>
      <guid>http://www.phpdeveloper.org/news/15321</guid>
      <link>http://www.phpdeveloper.org/news/15321</link>
      <description><![CDATA[<p>
Developing applications has become simpler and simpler these days and the multitude of IDEs out there can help you keep all of your files organized and linked together so you know everything is in its place. There's one thing that only a handful out there can do, though - enforce coding standards. Thankfully, there's a tool that can help you keep your code following down the right path and PHPBuilder.com <a href="http://www.phpbuilder.com/columns/PHP_CodeSniffer/Jason_Gilmore10212010.php3">has a new tutorial</a> about using it - PHP_CodeSniffer.
</p>
<blockquote>
Although defined according to formal grammar and syntax, programming languages -- like their spoken counterparts -- often leave their users with a great deal of leeway for creative expression. [...] It can even be singularly counterproductive if you do not maintain stylistic consistency across projects, as you'll need to continuously re-acclimate to differing syntactical variations.
</blockquote>
<p>
The PHP_CodeSniffer tool runs your code through a validation process and checks its structure against a coding standard (like the <a href="http://pear.php.net/manual/en/standards.php">PEAR standard</a>) and ensure it's formatted correctly. The tutorial shows you how to use the "phpcs" executable to test PHP, Javascript and CSSS files (using the Squiz standard).
</p>]]></description>
      <pubDate>Fri, 22 Oct 2010 08:40:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Using HipHop for Static Analysis]]></title>
      <guid>http://www.phpdeveloper.org/news/14857</guid>
      <link>http://www.phpdeveloper.org/news/14857</link>
      <description><![CDATA[<p>
In a new blog entry today <i>Sebastian Bergmann</i> quickly shows a method of <a href="http://sebastian-bergmann.de/archives/894-Using-HipHop-for-Static-Analysis.html">performing some code analysis</a> on code transformed by <a href="http://sebastian-bergmann.de/archives/880-My-Take-on-Facebooks-HipHop-for-PHP.html">HipHop for PHP</a>.
</p>
<blockquote>
<a href="http://sebastian-bergmann.de/archives/880-My-Take-on-Facebooks-HipHop-for-PHP.html">HipHop for PHP</a>, the source code transformer that turns PHP code into C++ code that can then be compiled with g++, can also be used for <a href="http://en.wikipedia.org/wiki/Static_code_analysis">static code analysis</a> to find problems in PHP source code.
</blockquote>
<p>
He includes a script that creates an XML document that both <a href="http://checkstyle.sourceforge.net/">Checkstyle</a> and <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> can use to check for a valid format on his sample "CodeErrors.js" file. He includes the script to create this XML file.
</p>]]></description>
      <pubDate>Tue, 27 Jul 2010 10:13:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[IBuildings techPortal: Using PHP_CodeSniffer]]></title>
      <guid>http://www.phpdeveloper.org/news/13369</guid>
      <link>http://www.phpdeveloper.org/news/13369</link>
      <description><![CDATA[<p>
On the IBuildings techPortal site today there's <a href="http://techportal.ibuildings.com/2009/10/12/usphp_code_sniffer/">a new article</a> from <i>Lorna Mitchell</i> about the use of the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> PEAR package to run formatting checks on your code.
</p>
<blockquote>
<a href="http://pear.php.net/package/PHP_CodeSniffer">PHP Code Sniffer</a> (PHPCS) is a package for syntax checking, available from <a href="http://pear.php.net/">PEAR</a>. It can check code against defined rules covering anything from whitespace through doc comments to variable naming conventions and beyond. In this article we'll look at getting started with PHPCS, using it to syntax check our files, and go further to look at how the rules are create and the standards defined.
</blockquote>
<p>
She goes through the installation (a simple call with the pear installer) and a few examples of code and the matching output for a few of the syntax formats included with the tool. She also has a section on the structure of some of the rules and looks at the sniff for defining functions for the PEAR standard.
</p>]]></description>
      <pubDate>Mon, 12 Oct 2009 07:58:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Benjamin Eberlei's Blog: PHP CodeSniffer for Netbeans v0.2]]></title>
      <guid>http://www.phpdeveloper.org/news/13344</guid>
      <link>http://www.phpdeveloper.org/news/13344</link>
      <description><![CDATA[<p>
<i>Benjamin Eberlei</i> has posted about <a href="http://www.whitewashing.de/blog/articles/121">some work he's done</a> on a plugin for the NetBeans IDE to integrate support for the PHP_CodeSniffer PEAR package's abilities.
</p>
<blockquote>
Previously the plugin used an unnecessary API which restricted the use to Netbeans 6.7.0 only. This API was removed so that the plugin should now work with all Netbeans Versions >= 6.7.0. Additionally when working the previous version would scan every PHP script on a file per file basis when the all projects or main projects filters were activated.
</blockquote>
<p>
You can find this latest update to the plugin on <a href="http://github.com/beberlei/netbeans-php-enhancements/">his github repository</a>. You can find out more about the PHP_CodeSniffer PEAR package <a href="http://pear.php.net/package/PHP_CodeSniffer">on its PEAR page.
</p>]]></description>
      <pubDate>Tue, 06 Oct 2009 12:58:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sameer Borate's Blog: Checking coding standards with PHP_Codesniffer]]></title>
      <guid>http://www.phpdeveloper.org/news/12237</guid>
      <link>http://www.phpdeveloper.org/news/12237</link>
      <description><![CDATA[<p>
On his code-diesel blog <i>Sameer</i> has <a href="http://www.codediesel.com/tools/checking-coding-standards-with-php_codesniffer/">posted a tutorial</a> that introduces you to the <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.php">PHP_CodeSniffer</a> library and some simple examples of it in action.
</p>
<blockquote>
A coding standard basically tells developers in what style they must write their code. If programmers work in a team than a coding standard ensures that each will be able to read the others code without any effort. [...] A tool which scans your source code and checks it against a standard would be quite a help. <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.php">PHP_CodeSniffer</a> is one such tool.
</blockquote>
<p>
The PHP_CodeSniffer package allows you to check code (to "sniff" it) and ensure that it matches against a certain format. The tool doesn't do any testing outside of that, though - no unit testing or functionality checking.
</p>
<p>
<i>Sameer</i> includes a guide to getting the tool installed and using it to get the source files in a certain directory. He also points to <a href="http://pear.php.net/manual/en/package.php.php-codesniffer.coding-standard-tutorial.php">a tutorial</a> for developing your own coding standards.
</p>]]></description>
      <pubDate>Mon, 30 Mar 2009 13:49:06 -0500</pubDate>
    </item>
  </channel>
</rss>

