Replies: 1 comment 1 reply
-
Hey, welcome to Rector community. Before you start using Rector, setup coding standard first. We use https://github.com/easy-coding-standard/easy-coding-standard, but you can use any tool. Apply PSR-12 first, to standardize spacing, indents, etc. Rector is using php-parser that works with AST (abstract syntax tree). It doesn't know tokens (spaces, indents, brackets), so using coding standard tool to "tidy" after Rector is crutial. Then, try to run Rector with first lowest set possibe. 5.3, then 5.4, 5.5, 5.6 etc. Going one PHP version at at time will give you more precise control on what Rector is changing: https://getrector.com/documentation/integration-to-new-project#content-3-one-php-set-at-a-time |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m new to Rector and would really appreciate some guidance.
I have a large project that I’ve been maintaining for 18–22 years. It’s currently running on PHP 7.4, and I want to upgrade it to PHP 8. The codebase is quite complex, so my first step is to identify only the core PHP methods or classes that have changed, been deprecated, or could potentially break in PHP 8.
So far, my Rector config looks like this:
When I run this, Rector suggests more than 45,000 changes and recommendations. That’s overwhelming to handle at once, so instead I’d like to:
Is this possible with Rector, and if so, how should I configure it?
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions