Rule for safely prepare for upgrade to new version of PHP #8285
Replies: 4 comments 10 replies
-
Your question highly depends on the codebase. I would recommend adding a PHP8.0 PHPStan check, and pick rector rules based on the PHPStan errors you get |
Beta Was this translation helpful? Give feedback.
-
You can do step by step, use The rules you want to skip will always depends on your needs. |
Beta Was this translation helpful? Give feedback.
-
This is a very sensible request. I would argue that it would greatly add to rector's usefulness with older, large codebases. |
Beta Was this translation helpful? Give feedback.
-
Is there a list of those rules ? We need to list all required rules to migrate from 7.2 to 8.2 (or version one-by-one). |
Beta Was this translation helpful? Give feedback.
-
The pre-condition: the project uses PHP version it needs to migrate from. For the sake of discussion let's upgrade from 7.1 to 8.0.
The problem: While rector provides a broad set of useful refactoring rules which are helpful when you want to make your project be more up-to-date with all the blows and whistles of 8.0, it doesn't provide "a strict minimum" set of rules to apply before switching to new version. all I actually want is to safely upgrade and with minimal edits make sure the project won't break.
The solution: set of rules like
UP_TO_PHP_80_BARE_MINIMUM
to only fix those.Beta Was this translation helpful? Give feedback.
All reactions