Rector conflicts with nikic/parser when using phpunit
#8566
-
|
Hello, I got a strange behavior where Rector conflicts with I have a project with the following conf in {
"require": {
"php": "^8.2",
"nikic/php-parser": "^5.0"
},
"require-dev": {
"rector/rector": "^1.0",
"symfony/phpunit-bridge": "6.4.*"
},
}I can run I'm also wondering if the problem does not come from Symfony's phpunit bridge, but even when using directly phpunit binary, I got the same error. NOTE: I saw #6958 but the answers to this discussions seems to not be helpful in my case any help would be appreciated :) thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 13 replies
-
|
Could you create simple reproducible repo and step by step to reproduce the error? Thank you. |
Beta Was this translation helpful? Give feedback.
-
|
Hi! thanks for your answer here is a reproducer: I basically did: and then: note that |
Beta Was this translation helpful? Give feedback.
-
|
at the time of writing this error is still reproducable (rector 2.1.7, phpstan 2.1.27, nikic/php-parser 5.6.1). Found a dirty fix just to run the tests for my own rector rules - just add Rector tool itself stops working after this, so I need to always jump between the dirty fix to run the tests and original version to run rector. |
Beta Was this translation helpful? Give feedback.
Hi @ivastly , this happen mostly on phpunit 12, you can preload it in composer.json:
see documentation https://getrector.com/documentation/troubleshooting-preload