-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
Rector requires phpstan 0.12.93 #6608
Comments
Hi, this is expected, see Line 10 in 3bcd73b
First, Rector needs to be tested and upgraded to newer PHPStan. In the past we had this version opened and it started to crash on PHPStan BC break. Now we got the safer way, to keep our users stable :) Feel free to send PR to upgrade |
Fixed at rectorphp/rector-src#585 |
In case someone finds this issue later, it's still possible to force installation of newer phpstan than rector allows at the given moment. For instance at the time of writing latest rector 0.11.52 requires phpstan 0.12.96 while the latest is 0.12.98. Yet I was still able to force it using this trick in composer.json:
|
@TomasVotruba This might possibly be worth mentioning in the readme for those who know what they're doing. What do you think? On a side note do you think phpstan version might be open again after phpstan 1.0 is out which should hopefully be more stable and not cause bc breaks anymore? |
This is useful, thanks for sharing. |
The issue is conflict in shared non-prefixed PHPParser namespace. Each project has their own, so it's a race condition issue. |
@TomasVotruba Not sure I understand. You mean there is one PHPParser installed normally as phpstan dependency and another one bundled into rector? If that's the case then why does Rector contain a copy when the parser will be there as a dependency anyway? 🤔 |
Ah yeah... rector's vendor directory contains non-prefixed nikic/php-parser as well as phpstan while also requiring them again as dependency... I understand that you need to require them in composer.json in order to prevent incompatible versions but imo they shouldn't be in the vendor directory. Ideally the vendor directory should strictly contain only prefixed packages. Is there some reason for having them there or can we remove them? |
That's does not solve the problem. |
Ideal solution is to unpack PHPStan and merge it's |
Bug Report
I have phpstan 0.12.94 installed. However, when I attempt to install rector/rector with composer, it complains because it will not accept anything higher than phpstan 0.12.93. I've tried this on multiple projects.
Minimal PHP Code Causing Issue
With phpstan 0.12.94 installed, running:
composer require rector/rector —dev
throws an error.
Expected Behaviour
I should be able to install the package successfully.
The text was updated successfully, but these errors were encountered: