php

  • submit to reddit

How To Make Files Downloadable With PHP

0 replies - 2423 views - 01/10/12 by Kalatravas Kostas in Uncategorized

Practical PHP Refactoring: Push Down Field

As happens often for a method, a field may be present in the base class of a hierarchy even if it is actually used only in some of the subclasses. This...

0 replies - 2652 views - 01/09/12 by Giorgio Sironi in Articles

How To Use Extract() Function In PHP

0 replies - 2287 views - 01/05/12 by Snippets Manager in Uncategorized

Practical PHP Refactoring: Push Down Method

In the scenario of today, some logic is in a superclass of a hierarchy, modelled as a method. However, this method is only useful for one of the subclasses in...

0 replies - 2577 views - 01/04/12 by Giorgio Sironi in Articles

Practical PHP Refactoring: Pull Up Constructor Body

After Pull Up Field and Pull Up Method, we explore today the last of this category of refactorings: Pull Up Constructor Body.The scenario consists of a series...

0 replies - 2955 views - 01/02/12 by Giorgio Sironi in Articles

Practical PHP Refactoring: Pull Up Method

We are in the part of the series where refactorings target mostly the elimination of duplicated code. For now, most solutions will achieve this goal via...

0 replies - 2961 views - 12/28/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Pull Up Field

We now enter in the territory of generalizations. It's a natural process, as we add more and more tests, for our code to become more general; but after we have...

0 replies - 4100 views - 12/26/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Replace Exception with Test

Sometimes catching an exception can be transformed in a preliminary check that avoid raising the exception in the first place. The code is then called only in...

0 replies - 2817 views - 12/21/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Replace Error Code with Exception

Error codes are mostly a relic of procedural programming: the object-oriented paradigm has introduced exceptions as a first-class mechanism to separate error...

2 replies - 3794 views - 12/19/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Encapsulate Downcast (and Wrapping)

In statically typed languages, each variable must have a minimal type known at compile time. PHP instead, a is dynamic language where variable can contain any...

0 replies - 3298 views - 12/14/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Replace Constructor with Factory Method

In the scenario of today, we have a complex constructor: read this definition as anything that does more work than assigning parameters to fields.The solution...

0 replies - 4555 views - 12/12/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Hide Method

In the scenario we address today, a method is not used from outside a class, or it's called only from a limited set of classes, such as the current inheritance...

0 replies - 3120 views - 12/08/11 by Giorgio Sironi in Articles

Saving Objects In Redis And Php

0 replies - 2329 views - 12/07/11 by Snippets Manager in Uncategorized

Practical PHP Refactoring: Remove Setting Method

A setter for a certain field is present: maybe it's a generated method, or is used for Dependency Injection.However, in the current state of the code, there...

5 replies - 3372 views - 12/06/11 by Giorgio Sironi in Articles

Practical PHP Refactoring: Introduce Parameter Object

In the scenario of today, two or more parameters are often passed together to a set of similar methods. This happens for example with timing information...

0 replies - 3592 views - 11/30/11 by Giorgio Sironi in Articles