-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
TestContainer should not be @internal
#46483
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
For reference, this was also discussed shortly on Symfony Slack yesterday:
|
Can you confirm that the change I propose in #46496 works as well for you? |
@xabbuh Confirmed! |
…rnal class (xabbuh) This PR was merged into the 6.1 branch. Discussion ---------- [FrameworkBundle] update docblock to not expose the internal class | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #46483 | License | MIT | Doc PR | The change was introduced in #44695 motivated by the idea to be able to use the `getServiceIds()` and `getRemovedIds()` methods which are Symfony-specific methods. Exposing the `TestContainer` has the drawback of static analysis tools complaining about making use of internal classes. Since the interesting methods are part of the base `Container` class which is not internal I propose to change the docblock to return an instance of this class instead. Commits ------- f30db82 update docblock to not expose the internal class
Symfony version(s) affected
6.1.0
Description
#44695 added
@return TestContainer
toKernelTestCase::getContainer()
. However,TestContainer
is marked@internal
, which makes any callsstatic::getContainer()->get(MyService::class)
invalid, for example to Psalm (and possibly also to IDEs):How to reproduce
Possible Solution
Remove
@internal
fromTestContainer
.Additional Context
No response
The text was updated successfully, but these errors were encountered: