Dependency Injection Breaks Encapsulation

Well clearly you do! You used the fact that require_once lines are needed for classes as an example of DI needing more lines of code. Those repeated require_once lines are a perfect example of where an autoloader can solve the issues you had. Besides, I already answered this in detail with an example, using your own codebase that solves the problem.

… I have repeatedly demonstrated this. DI is:

  • Fewer lines of code
  • Faster to execute due to less code
  • Quicker to write
  • Infinitely more flexible

You’re the one making the claim that “DI IS EVIL (sometimes)” It’s is 100% up to you to back up that claim.

You must be trolling at this point.

I will repost this, because it’s a nuance you seem unable to grasp: