rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.72k stars 687 forks source link

DX: Add Docker dev setup #7774

Closed Trusted97 closed 1 year ago

Trusted97 commented 1 year ago

Hello everyone! My name is Gianluca and I work for https://github.com/immobiliare. I want to thank you so much for the amazing work done on rector. I really appreciate your work and would like to suggest adding docker to improve the contributions from the whole community.

To give you an idea of ​​what I mean I leave you a link to PHP-CS-FIXER that have already implemented this

Best regards

P.s. If you think it's something useful, I'll be happy to send my PR to add this feature!

TomasVotruba commented 1 year ago

Hi, we've had something like this before, but it got unmaintained and cause lot of troubles to our users. Also, the best way to run Rector is directly on the project. You get autoloding, paths, static reflection and typical paths out of the box.

Yet, if you want to maintain community Docker package for Rector, go for it :+1:

Wirone commented 11 months ago

Just for the record: the difference between Rector and PHP-CS-Fixer in terms of Docker is that our source code is compatible with 7.4-8.2 so we can run it on several Docker services with different PHP versions, while Rector is downgraded during build and effectively can be run on lower PHP versions only after the build/release. Locally you run Rector on PHP version that is required for development.

Docker runtime in Rector got unmaintained somehow, because (IMHO) @TomasVotruba does not understand how Docker works and/or wasn't able to provide me enough information why my changes in rectorphp/rector-src#1928 don't fit the "native PHP" approach. There is also possibility that I couldn't grasp the problem Tomas tried to point out. I can provide refreshed PR with these changes if there's interest, though 🙂.