8000 [DI] Add getter injection by nicolas-grekas · Pull Request #20973 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[DI] Add getter injection #20973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2017
Merged

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Dec 17, 2016
Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #20657, #835
License MIT
Doc PR symfony/symfony-docs#7300

Getter overriding by the container will allow a new kind of dependency injection which enables easier laziness and more immutable classes, by not requiring any corresponding setter. See linked issue for more.

This is WIP:

  • wire the concept
  • dump anonymous classes with PhpDumper
  • generate at runtime in ContainerBuilder::createService
  • tests
  • make it work on PHP 5