-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Compiled Container Does Not Call Base Class Constructor #25343
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
Comments
We could add some "initialize" hook that could be called at the end of the constructor, based on a new option to the "dump()" method. |
@nicolas-grekas Sure, I'll work something out probably tomorrow. |
I think we make this non-optional: the parent constructor used to be called with a ParameterBag instance previously at the very beginning of the overridden constructor. Let's always call |
see #25762 |
…uctor (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [DependencyInjection] always call the parent class' constructor | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #25343 | License | MIT | Doc PR | Commits ------- a1b1484 always call the parent class' constructor
Uh oh!
There was an error while loading. Please reload this page.
While using the DIC component outside of the Symfony I found I need to define my own
base_class
while callingPhpDumper::dump
in order to provide custom functionality. Compiled container indeed contains my class as a parent, however constructor of the class is not called. The generated constructor looks like that:I checked and this behavior is consistent across 4.0, 3.4 and 3.3 with or without
as_files
enabled. I guess then the decision was deliberate.Is there any reason why not to call the base container constructor? WDYT about adding such option?
The text was updated successfully, but these errors were encountered: