The code here, represented as steps, is the progression of a refactoring on a legacy codebase. It is PHP version of the Java code shown in the Martin Fowler book "Refactoring".