-
Notifications
You must be signed in to change notification settings - Fork 653
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
Could not get class storage for Mockery\Adapter\Phpunit\MockeryPHPUnitIntegrationAssertPostConditions #1537
Comments
This is with Psalm 3.2.5 btw, and the fatal error happens here:
Stack trace if this helps:
FWIW, Psalm 2.x would still parse and analyze the code, but spit out an |
Yeah, you should be able to create a stub file with that |
I was able to get that to work, maybe something that should be added to the Mockery plugin? I can try to put together a PR for that if you think that's where something like this belongs... |
Yes please! |
I'm not certain if this belongs here or in https://github.com/psalm/mockery-psalm-plugin but it might be general enough of an issue that it's a Psalm issue, not a plugin issue.
I get this error when trying to analyze a class that uses the
Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration
trait (which is required for Mockery to perform its assertions on if a mocked method was called the expected number of times or not).Digging a bit, that particular trait has this bit of code at the beginning of the file before the class is defined:
https://github.com/mockery/mockery/blob/master/library/Mockery/Adapter/Phpunit/MockeryPHPUnitIntegration.php#L25
Seems that this is done to change which trait ends up loading in based on the PHPUnit version being used. However, the
class_alias
seems to be throwing off Psalm when analyzing that trait.If this is too much of an edge case to resolve in Psalm, is it possible to tell Psalm that
\Mockery\Adapter\Phpunit\MockeryPHPUnitIntegrationAssertPostConditions
is actualy an alias for\Mockery\Adapter\Phpunit\MockeryPHPUnitIntegrationAssertPostConditionsForV7AndPrevious
(in my case)?The text was updated successfully, but these errors were encountered: