Tutorials »

Developers who are familiar with the topic of clean code know that static methods are a problem, especially if it comes to testability. Static makes the code global, and if there is some kind of state involved it is even more a problem because this is global state then - both a maintenance and testability nightmare.

Unfortunately, sometimes you don't get around of using such code. This could be due to a third party library you have to use, or even because of limitations of PHP itself.
Posted by girish.r 927 days ago (http://www.stubbles.org)
Discuss  | Bury | Tweet This | Tagged: dependency injection static methods
Add To 

Who Voted for this Story

Comments

No one has commented on this article yet.

Log in to comment or register here.