<?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, 07 Sep 2008 09:49:55 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Soledad Penades' Blog: Signs your PHP needs refactoring]]></title>
      <guid>http://www.phpdeveloper.org/news/7980</guid>
      <link>http://www.phpdeveloper.org/news/7980</link>
      <description><![CDATA[<p>
As <a href="http://feeds.feedburner.com/~r/funkablog/~3/122396798/">mentioned by</a> <i>Ed Finkler</i>, there's a list of <a href="http://www.soledadpenades.com/2007/06/05/signs-your-php-needs-refactoring/">signs your PHP needs refactoring</a> from <i>Soledad Penades</i>.
</p>
<blockquote>
<p>
I have had to go through a php application recently which has given me more than one headache and has required me to use all my possible patience. While working with it, I thought This is good material for an article, so that nobody else does the same in the future, and nobody else will need to experience the same displeasure as I have had to.
</p>
<p>
So here are the signs your PHP application needs a serious refactoring, right now
</p>
</blockquote>
<p>
Included in <a href="http://www.soledadpenades.com/2007/06/05/signs-your-php-needs-refactoring/">the list</a> are things like:
</p>
<ul>
<li>Uses global variables
<li>Everything's an array
<li>The neverending switch
<li>Interface inconsistency
</ul>
<p>
It hits on one of the thing that bugs me too, the problem of "Brackets galore" - so many subarrays that you have to resort to three or more sets of bracketed keys to get to the value you want. It's bad enough trying to follow someone else's code without having to "trace down" an array to figure out which of the values they're talking about.
</p>]]></description>
      <pubDate>Tue, 05 Jun 2007 16:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Raphael Stolt's Blog: Rolling your own Phing task]]></title>
      <guid>http://www.phpdeveloper.org/news/7623</guid>
      <link>http://www.phpdeveloper.org/news/7623</link>
      <description><![CDATA[<p>
Wanting to automate a common task he found himself doing, <i>Raphael Stolt</i> came up with <a href="http://raphaelstolt.blogspot.com/2007/03/rolling-your-own-phing-task.html">his own process</a> and use <a href="http://raphaelstolt.blogspot.com/2007/03/rolling-your-own-phing-task.html">Phing</a> to help.
</p>
<blockquote>
To round off an older article on this blog called "<a href="http://raphaelstolt.blogspot.com/2007/01/use-php-5-reflection-api-to-track.html">Using the PHP 5 reflection API to keep track of unsolved refactorings</a>" I wanted to automate the following task: collect and log some information about developer marked unsolved refactorings for a single class file or more common multiple files of an whole directory. And as I'm getting more and more acquainted with <a href="http://phing.info/trac/">Phing</a> I wanted to craft this custom task by using it's provided extension possibilities.
</blockquote>
<p>
He <a href="http://raphaelstolt.blogspot.com/2007/03/rolling-your-own-phing-task.html">gives examples</a> of what the "unsolvedRefactoring" notation looks, the XML mapping for its definition, and the code that actually makes the mapping work - and makes it easy to pull out the needed information. There's two versions presented, one a normal pull and the other modified slightly to "actually retrieve the metadata of the methods marked as improveable via the @unsolvedRefactoring doclet". And, finally, the integration with Phing comes, showing how to run the files and what the results should look like.
</p>]]></description>
      <pubDate>Fri, 13 Apr 2007 10:22:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: July 2006 Issue Released]]></title>
      <guid>http://www.phpdeveloper.org/news/5888</guid>
      <link>http://www.phpdeveloper.org/news/5888</link>
      <description><![CDATA[<p>
php|architect has <a href="http://hades.phparch.com/hermes/public/viewnews/index.php?id=3282">announced today</a> that their July 2006 issue of their magazine has officially been released.
</p>
<p>
Articles in <a href="http://www.phparch.com/issue.php?mid=84">this issue</a> include:
<ul>
<li><i>Anant Narayanan</i>'s look at development in PHP-GTK 2 (cover story)
<li><i>Eric Angel</i>'s tutorial on using random images in form validation
<li><i>Stefan Priebsch</i>'s thoughts on code structure and refactoring
<li>and, of course, the Security Corner (with <i>Chris Shiflett</i>) and Test Pattern (with <i>Jeff Moore</i>) columns
</ul>
</p>
<p>
You can either <a href="http://www.phparch.com/issue.php?mid=84">order a single issue</a> or get a year's subscription of this great publication. The issue costs about $4.20 USD and the full year only comes in at $35.40 USD.
</p>]]></description>
      <pubDate>Thu, 27 Jul 2006 08:18:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Scarletlullaby.com: Refactoring to Rails (MVC) in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5649</guid>
      <link>http://www.phpdeveloper.org/news/5649</link>
      <description><![CDATA[<p>
<i>Ryan</i> from Scarletlullaby.com has posted <a href="http://www.scarletlullaby.com/articles/2006/06/21/refactoring-to-rails-mvc-in-php">a new item</a> today looking at the process he followed to refactor a Rails MVC application into PHP.
</p>
<blockquote>
<p>
Most of my work of late has involved refactoring and rewriting insanely large and out of control programs so that it's easier to add features, follow program flow, etc. Since I've been using Rails so much in my personal projects, I tend to refactor things in a way that makes them resemble Rails in a funny, PHP-molested way. 
</p>
<p>
I've come up with fairly decent and clean ways to implement most of the functionality available in Rails; basically, the PHP apps are set up using a frontcontroller, which delegates to instances of page controllers. 
</p>
</blockquote>
<p>
He <a href="http://www.scarletlullaby.com/articles/2006/06/21/refactoring-to-rails-mvc-in-php">looks at</a> some of the "strange thoughts" he's had in the process, including issues dealing with POST/GET values, session data, and difficulty surrounding the fact that PHP dosen't support multiple inheritance.
</p>]]></description>
      <pubDate>Wed, 21 Jun 2006 14:51:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jim Plush's Blog: Cyclomatic Complexity for the Test Driven PHP'er]]></title>
      <guid>http://www.phpdeveloper.org/news/5516</guid>
      <link>http://www.phpdeveloper.org/news/5516</link>
      <description><![CDATA[<p>
Unit testing in PHP applications is growing more and more in popularity, so much so that some developers get into it, test all of their code and aren't exactly sure when enough is enough. <i>Jim Plush</i> has <a href="http://www.litfuel.net/plush/?postid=137">a suggestion</a> for those kinds of testers - consider the cyclomatic complexity.
</p>
<quote>
<i>
<p>
It's one of the most common questions you ask when you first start using Test Driven Development or Unit Testing in general... When am I done?
</p>
<p>
It's the point you feel confident when all your tests exercise the code in your classes. How do I know when that point is? I've come across a new way of finding this point using something called cyclomatic complexity. Developed by Thomas McCabe in the 70's cyclomatic complexity is a simple measurement of how complex a piece of code is. One of the nice parts of it is that you can use it when working with unit tests.
</p>
</i>
</quote>
<p>
To illustrate, he <a href="http://www.litfuel.net/plush/?postid=137">gives a simple example</a> of a function with only a function call and return inside. This has a cyclomatic complexity rating of 1 (the lowest). Now, start adding in ifs, loops, and other ways for the data to go and you start adding more complexity levels. <i>Jim</i> suggests that this can be another useful unit testing measurement - one more unit test for each level of complexity.
</p>
<p>
He also notes a pleasant side effect of this sort of classification:
</p>
<quote>
<i>
The other nice part of a CC number is you can quickly find out when a method is ripe for refactoring. If you have a method with a CC number of 20 you know you most likely have a problem on your hand.
</i>
</quote>]]></description>
      <pubDate>Mon, 05 Jun 2006 14:45:55 -0500</pubDate>
    </item>
  </channel>
</rss>
