Sorry, but your code is STUPID! Nobody likes to hear that their code is stupid. It is offending. Don’t say it. But honestly: Most of the code being written around the globe is an unmaintainable, unreusable mess.
What characterizes such code? What makes code STUPID?
http://www.tonymarston.net/php-mysql/dependency-injection-is-evil.html