Avoid reporting with TestContainer::get as internal#441
Merged
ondrejmirtes merged 2 commits intophpstan:2.0.xfrom May 14, 2025
Merged
Avoid reporting with TestContainer::get as internal#441ondrejmirtes merged 2 commits intophpstan:2.0.xfrom
ondrejmirtes merged 2 commits intophpstan:2.0.xfrom
Conversation
0d5c53a to
46866b0
Compare
46866b0 to
c8644e1
Compare
ondrejmirtes
requested changes
May 13, 2025
|
|
||
| $isTestContainerType = (new ObjectType('Symfony\Bundle\FrameworkBundle\Test\TestContainer'))->isSuperTypeOf($argType); | ||
| if ( | ||
| $argType instanceof TestContainerType |
Member
There was a problem hiding this comment.
Could we simplify this and not report an error when we simply have the upper-most ContainerInterface and are in a subclass of KernelTestCase?
The custom type is wrong since it doesn't implement equals, describe and isSuperTypeOf. But I think we don't need it at all.
Contributor
Author
There was a problem hiding this comment.
Could we simplify this and not report an error when we simply have the upper-most ContainerInterface and are in a subclass of KernelTestCase?
I think this is not fully true, but this might be good enough.
Contributor
Author
There was a problem hiding this comment.
Should be better with the last commit.
6c9961f to
2834e4a
Compare
Member
|
Thank you. |
This was referenced May 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @ondrejmirtes
I tried to solve both #210 and symfony/symfony#60299 with another implementation (by trying to copy the idea of the QueryType in phpstan-doctrine).
I wonder if it's something going in the right direction or not.