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
Cannot declare class Composer\InstalledVersions #8117
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
Sounds like it could be caused by or at least related to phpstan/phpstan-src@087141e |
Please run with Xdebug (don't forget --xdebug) so that we get a stack trace. Or create a small reproducing repository that shows the problem. Thank you. |
Have the same error |
@Jurigag This is useless information without attaching any more details that I asked for. |
There is no nice stacktrace output with --xdebug?
i try some additional tests or create a reproducer |
Wrong mode probably then, you need |
ok changed from
|
Looks like this for me
|
So it seems that InstalledVersions is already being load here:
|
has something about phpstan's handling of the |
The issue here is that Phpstan first loads this InstalledVersions from internal composer from phar. Then it tries to load it from the project vendor, and then it fails, because php already have this in memory, seems a bit off. |
Hey, when you check actually the internal composer all other classes has correctly prefixed namespaces so there is no conflict like |
Alright, PHPStan will no longer load its own Composer\InstalledVersions: phpstan/phpstan-src@acbb55b Please test it once I release PHPStan 1.8.8. |
Alright, please test it: https://github.com/phpstan/phpstan/releases/tag/1.8.8 |
fixed it, thanks 👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
After Upgrading phpstan/phpstan (1.8.2 => 1.8.7)
When I execute
phpstan
i get the error1.8.2 and older versions works fine
The prob occurs in 1.8.3 - 1.8.7
Symfony/ApiPlatform Project.
Code snippet that reproduces the problem
phpstan
Expected output
normal stan output
The text was updated successfully, but these errors were encountered: