xp-forge / inject

Dependency injection for the XP Framework
0 stars 0 forks source link

Remove support for field and method injection #11

Closed thekid closed 8 years ago

thekid commented 8 years ago

This was already removed for the get() usecase in 0.5.0, but an escape route was left by still providing $inject->into(). This pull request cleans up with this alltogether.

Let me reiterate and summarize the scenarios of incorrect usage of dependency injection containers:

  • Field injection
  • Setter injection
  • Passing injector as a dependency
  • Making injector a global singleton

Source: http://www.yegor256.com/2014/10/03/di-containers-are-evil.html

Since we're already preparing a major release after merging PR #10 this BC break might as well go in, too.

thekid commented 8 years ago

After reading up on this on StackOverflow and other sources, I'm still convinced removing member injection support is correct.

thekid commented 8 years ago

:shipit: Shipped in 2.0.0-RELEASE