Skip to content
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

Call all involved class on TypeSpecifierAwareExtension #12741

Open
ChinaskiJr opened this issue Mar 14, 2025 · 0 comments
Open

Call all involved class on TypeSpecifierAwareExtension #12741

ChinaskiJr opened this issue Mar 14, 2025 · 0 comments
Labels
Milestone

Comments

@ChinaskiJr
Copy link

ChinaskiJr commented Mar 14, 2025

Bug report

When working with @brambaud on this feature request for phpstan-phpunit, we discovered a bug that been confirmed by @ondrejmirtes.

We need to call all involved class when creating a TypeSpecifierAwareExtension, the involved code is here : https://github.com/phpstan/phpstan-src/blob/2.1.x/src/Analyser/TypeSpecifier.php#L523

The specifyType method is only called if there is one and only one referenced class. In our case, we can have an intersection of a MockObject and the class being mocked.

Did PHPStan help you today? Did it make you happy in any way?

It makes me happy everyday 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants