<?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>Wed, 22 May 2013 19:08:42 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[NetTuts.com: PSR-Duh!]]></title>
      <guid>http://www.phpdeveloper.org/news/19452</guid>
      <link>http://www.phpdeveloper.org/news/19452</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a post that <a href="http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh/">talks about applying the PSR formatting</a> to your application's code. If you haven't already read their <a href="http://net.tutsplus.com/tutorials/php/psr-huh">introduction to the PSRs</a>, it's highly suggested.
</p>
<blockquote>
In a previous lesson here on Nettuts+, you learn about <a href="http://net.tutsplus.com/tutorials/php/psr-huh">PSR</a>; however, that article didn't detail the process of integrating that coding style into your projects. Let's fix that!
</blockquote>
<p>
They briefly recap the main two PSRs (PSR-1 and PSR-2, but no mention of PSR-3 the logging interface) and show code examples of them being applied. They also point to the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> tool that you can use to keep your code in the correct structure. Instructions are included to install it specifically for the Sublime Text 2 editor via <a href="http://wbond.net/sublime_packages/package_control">package control</a>. It's just a command-line tool, though, so it could be integrated with just about any other editor/IDE out there too.
</p>
Link: http://net.tutsplus.com/tutorials/tools-and-tips/psr-duh]]></description>
      <pubDate>Fri, 12 Apr 2013 10:46:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Marek's Blog: PHP 5.4 Compatibility Coding Standard for PHP_CodeSniffer]]></title>
      <guid>http://www.phpdeveloper.org/news/17618</guid>
      <link>http://www.phpdeveloper.org/news/17618</link>
      <description><![CDATA[<p>
In the wake of the <a href="http://phpdeveloper.org/news/17614">official release of PHP 5.4</a> <i>Sebastian Marek</i> has made a <a href="http://criticallog.thornet.net/2012/03/02/php-5-4-compatibility-coding-standard-for-php_codesniffer/">quick post</a> to his blog about bringing PHP_CodeSniffer rules help bring his code up to date with this latest version.
</p>
<blockquote>
So with PHP 5.3 upgrade underway (and <a href="http://php.net/releases/5_4_0.php">PHP 5.4 out of the door now</a>!) I thought it's time to prepare for PHP 5.4 and make sure we're compatible. So by looking at Wim Godden's <a href="https://github.com/wimg/PHP53Compat_CodeSniffer">PHP53Compatibility code sniffs</a> I have created a base for PHP 5.4 sniffs that we want to use to make sure we're compatible.
</blockquote>
<p>Sniffs included in set are:</p>
<ul>
<li>PHP54Compatibility_Sniffs_PHP_BreakContinueVarSyntaxSniff
<li>PHP54Compatibility_Sniffs_PHP_DeprecatedFunctionsSniff
</ul>
<p>
You can grab this custom set of sniffs either from <a href="https://github.com/proofek/PHP54Compatibility">his github repository</a> or from <a href="http://proofek.github.com/pear">his personal PEAR channel</a> if you'd rather install it that way (alpha channel). 
</p>]]></description>
      <pubDate>Fri, 02 Mar 2012 10:52:32 -0600</pubDate>
    </item>
    <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>
  </channel>
</rss>
