-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Unexpected item 'parameters › checkAlwaysTrueLooseComparison' #7141
Comments
it seems phpstan.phar from vendor is read early before autoload, it possibly solvable by flip autoload in Lines 31 to 32 in 0e76f19
into: $autoloadIncluder->autoloadProjectAutoloaderFile();
$autoloadIncluder->loadIfExistsAndNotLoadedYet(__DIR__ . '/../vendor/scoper-autoload.php'); @internalsystemerror could you verify if that solve it? |
@samsonasik Sadly not, same error. |
Could you create sample repository for it? it may happen again when new parameter config added to next patch phpstan version so it should be solved by modify the use of autoload, or mark phpstan in scoped vendor as replaced via composer replace:
before build scoped. |
I'm currently experiencing a tight approaching deadline, and we run rector against our entire monorepo so it would take me some time to figure out an exact reproduction. Forcing I did try a combination of ordering of those lines in |
@internalsystemerror please try latest dev-main for now as its phpstan vendor is now re-generated to latest phpstan:
|
Yep, that appears to have fixed it, thank you! As to how to solve it more permanently however, I would be interested in looking into this further, but work permitting. |
The vendor prefixed seems include phpstan bootstrap from existing vendor itself: rector/vendor/composer/autoload_files.php Line 17 in af9fe53
|
Saw same error on Sonata. I am also interested on a more permanent solution (I know it will be fixed on 0.12.23). My plan is to keep integrating rector on all Sonata repositories If I understand correctly, this comes from the fact that rector ships its own vendor folder with phpstan installed on it, but that phpstan still looks for the phpstan configuration of the outside vendors, right? |
Rector 0.12.23 released. I am closing it, if the new phpstan patch add new parameter again in the future, it may need a new release or use dev-main in the meantime if the phpstan prefixed vendor is still loaded first. |
Bug Report
Minimal PHP Code Causing Issue
I'm not able to reproduce this using the demo, however this is extremely similar to #7133 and appears to be caused by
phpstan/phpstan-strict-rules
. The specific error:I will update this as I investigate to try and get further information. The only place I can find
checkAlwaysTrueLooseComparison
is in the filerules.neon
in the strict-rules package.This was introduced in phpstan/phpstan-strict-rules@f3ca646 and released in v1.2.1. Rolling back to v1.2.0 fixes the issue.
Expected Behaviour
No error
The text was updated successfully, but these errors were encountered: