-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] ContainerInterface cause ClassNotFoundException #52596
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
Looks like the PHP dumper has been updated to reference the constant but without adding the corresponding use statement in the generated code. |
Can you please confirm that #52597 fixes the issue? |
@nicolas-grekas Yes it does fix the issue. |
nicolas-grekas
added a commit
that referenced
this issue
Nov 15, 2023
…erenced services (nicolas-grekas) This PR was merged into the 7.0 branch. Discussion ---------- [DependencyInjection] Fix dumping containers with null-referenced services | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52596 | License | MIT Commits ------- 89f71ab [DependencyInjection] Fix dumping containers with null-referenced services
@nicolas-grekas I guess you missed that this bug exists since 6.0, so it's not enough to fix it only in the 7.0 branch. |
nicolas-grekas
added a commit
that referenced
this issue
Nov 29, 2023
…erenced services (nicolas-grekas) This PR was merged into the 6.3 branch. Discussion ---------- [DependencyInjection] Fix dumping containers with null-referenced services | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52596 | License | MIT Backporting #52597 to 6.3 /cc `@connorhu` Commits ------- 45a5994 [DependencyInjection] Fix dumping containers with null-referenced services
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected
6.0
Description
This code is generated by DI and cause ClassNotFoundException for me:
And the exception is:
Attempted to load class "ContainerInterface" from namespace "ContainerSF7xQsW". Did you forget a "use" statement for e.g. "Symfony\Component\DependencyInjection\ContainerInterface" or "Psr\Container\ContainerInterface"?
The PhpDumper does generates wrong code:
symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php
Line 2058 in de3d115
This patch cause the regression: 16fcdda
How to reproduce
To be honest, I don't know how to reproduce this. I also don't fully understand why it only happened to me and not to others.
Possible Solution
Either of the two example codes will generate working code.
or
Additional Context
No response
The text was updated successfully, but these errors were encountered: