-
-
Notifications
You must be signed in to change notification settings - Fork 688
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
[Support] Running Rector on a PHP 7.2 project #2417
Comments
To avoid that error, I tried running Rector's PHAR from inside a Docker container (PS: here's my previous attempt) using :
And :
It worked (Rector runs - no error regarding
I thought the intent of building a PHAR version was to prefix Rector's dependencies (like |
The PHAR file needs to be tested in the wild first to catch all edge cases we didn't think of. It seems there are 2 differnt version of php-parser.
|
The project is using |
PHPStan 0.12 needs That's the only dependency that needs to be in sync with these tool |
Try upgrading hydrator to v3, it should do the job |
v3 requires |
Ah, I didn't notice that. Here are more ideas: {
"nikic/php-parser": "4.3 as 3.0"
} or composer require rector/rector --ignore-platform-reqs Also you might ask @Ocramius to go down with PHP 7.2 to allow it. |
Looking at generated-hydrator's 3.0 release notes, I think the whole point was to upgrade I'm not sure how to use your tricks in this Docker context, but I'll give it a try. |
php-parser 4.3 allows PHP 7.0, so that's unrelated. It's rather pushing people to upgrade code (which is a good thing), just clashes with your code :/ |
If I were you, I'd just:
It's 10 minute work and works perfectly for your temporary situation |
As mentioned in Ocramius/GeneratedHydrator#114 (comment), forking is the correct workaround if upgrading (endorsed - endorsement conveyed by me bumping dependency version regularly) isn't viable. I realise it's painful, but making it painful is part of why I do it: it makes companies more aware that newer stuff requires newer environments, and not everything comes for free (as @gnutix already noticed directly) |
So I've forked
And rector.phar within a Docker container built with :
So this is yet another dependency conflict, but on What were the odds ? 🙄 Guess I'll use ECS in a Docker container too... |
Got it running by using ECS in Docker. Finally!! 🎆 |
Ever seen these ones ? Here's the project configuration, running on both
I guess this is probably due to the fact that I'm executing Rector from
This seems related to the new prefixed feature. I tried setting
This seems to conflict with PHPStan annotations (like |
Sorry, there was too many issues at once to focus clearly, so I'm checking it just now.
It should have been your app's Kernel, not Rectors. But this process was refactored to
According to error, this format is not implemented yet in I'll see what I can do about it |
This look like path issue related to Docker. I assume this line won't get out of Docker:
|
I tried to do experimental testing but didn't make it fail. If that's still a problem, create new issues so prevent flood of mised problems here. Thank you ❤️ |
|
rectorphp/rector-src@e368dab [Downgrade] Add class method param to DowngradeEnumToConstantListClassRector (#2417)
I'll centralize all my reports in this ticket, otherwise it'll get messy. All my attempts are simply to get Rector running on my company's project : which is using ocramius/hydrated-generator, which depends on nikic/php-parser, and as we're running on PHP 7.2, it's restricted to a lower version which clashes with the version 4.x included in Rector's vendors.
My latest error has been reported here and still occurs with the latest PHAR version and can be resumed with :
The text was updated successfully, but these errors were encountered: