I found the root cause of a bug simply by cleaning the code: extracting, deduplicating, early returns, and variable names that help reason about the code. Then it became blindly obvious.

Clean your code.

@afilina I made a MR/PR just today to install and get #Rector installed, in part to help upgrade from Symfony 6.4 & PHP 8.3 for their main website. He asked why I would leave the package, configuration, and a Makefile to run it in the codebase, instead of just using it as a one-shot upgrade tool.

What you said, is why I want it to stay, and at least gradually rolled out with improvements

On the bright side, this would be the first big commit I made to the codebase, 'cos I only started last week, and that was always going to be my first task.

@alister @afilina I used to think Rector was a one shot tool, but then discovered that even in the case of an upgrade, you often get people committing after the fact deprecated stuff.

This helped me understand Rector had to be part of the CI.

And once it’s there, I started to learn more about it and how it can be used to do more than just upgrade code

@afilina how many times…

@afilina @webaware Great work!

I’ve been doing the same and I’ve discovered two potential excellent optimisations that can be done.