-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
debug:container --types & debug:autowiring can fail with missing deps #24639
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
What about not checking that (but checking that there is a |
Great question! For a Flex app with some basic dependencies installed, the only alias that does not have a So in practice, if we switched to look for a What if we did: A) If there is a |
Fixed in #24744 |
… (weaverryan) This PR was merged into the 3.3 branch. Discussion ---------- debug:container --types: Fix bug with non-existent classes | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24639 | License | MIT | Doc PR | n/a I've just tested manually that this *does* fix the issue I described in #24639. Oddly enough, in a "stock" Flex project, after this patch, there is one *additional* "type" that's reported: > Symfony\Component\PropertyAccess\PropertyAccessorInterface alias for "property_accessor" That is a valid type... for some reason `interface_exists()` return false for this (??? maybe a quirk of my machine). Anyways, this is also "fixed" with this new approach. Commits ------- 4bb9d82 Fixing a bug where non-existent classes would cause issues
Here's the setup:
bin/console debug:container --types
The issue is that SensioFrameworkExtraBundle registers a service that relies on
symfony/security
. Since security is not present, this service is removed: https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/master/DependencyInjection/Compiler/OptimizerPass.php#L27However, I believe that the
debug:container
command uses the container before some of these removal passes. So, this service is still present when we check to see if the class exists: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php#L248. The autoloader causes the class to be loaded, and error because the parent class is missing.So... long way of saying, we just need a safer way of checking to see if the service id is an existent class.
The text was updated successfully, but these errors were encountered: