-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances #27462
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
[FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances #27462
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair solution for the main underlying confusing issue.
} | ||
|
||
private function configureController($controller) | ||
private function configureController($controller, $class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string $class
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
$controller->setContainer($previousContainer); | ||
if ($controller instanceof AbstractController) { | ||
$previousContainer = $controller->setContainer($this->container); | ||
if (null !== $previousContainer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test can maybe be inverted if (null === $previousContainer) else
for clarity?
e90e920
to
38277b7
Compare
…ctController instances
38277b7
to
e2f344f
Compare
…ainer in AbstractController instances (nicolas-grekas) This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Should enhance DX by preventing situations like #27436. Commits ------- e2f344f [FrameworkBundle] Deprecate auto-injection of the container in AbstractController instances
Should enhance DX by preventing situations like #27436.