Instant Upgrades and Instant Refactorings for PHP Applications. Why do it manually?
#rectorphp
Created by @votrubaTgetrector.com/hire-team PHP CommunityJoined December 2018
I've just realized we didn't have an offical way to sponsor @rectorphp ... Fixed it first task today ⬇️
If you're a company using Rector and saving you time and money, consider giving back to support on-going development🙏
github.com/sponsors/recto…
Symplify PHPStan rules 14.11.0 just dropped 🎉
2 lines in your phpstan.neon, two new safety nets:
* ctor: true # use constructors, not setter soup
* mocks: true # spot fragile PHPUnit mocks
Bonus: smarter return types for Symfony, Laravel & path functions - now built in.
PHP 8.4 ✅
Check the full release with examples ⬇️
github.com/symplify/phpst…
Rector is now on GitHub Sponsors! 🎉
Rector upgrades and refactors PHP, frameworks and keeps technical debt away💙
Work that takes attention and time, done automatically: in CI or CLI, for free
If Rector saves your team time, consider sponsoring its development:
👉 github.com/sponsors/recto…
Your sponsorship keeps it free, open, and actively maintained 💙
PHPStan core is just the start. I built a searchable index of 263 community @phpstan rules from 11 popular packages - each with its class name, what it catches, and wrong/correct examples.
Goldmine for tightening your PHP codebase 👇 tomasvotruba.com/phpstan-rules-…
Looking forward to speaking @laravelliveuk about @rectorphp
It's a deep dive covering why Rector matters. How it works, and how to create your own custom rules. By the end of the talk you'll be ready to write your first custom Rector!
🎟️ laravellive.uk
Instead of writing every Symfony/Laravel/... @rectorphp upgrade config manually for every minor version there is,
maybe Rector could look into @deprecated / #[Deprecated] and figure out the change itself, right?
Would this be useful? WDYT? 🤔
Now important than ever:
surface all the hidden mixed types in your code using @phpstan extension,
to avoid bugs like:
class SomeClass
{
public function call(array $ids)
{
}
}
/** @var mixed $someClass */
$someClass->call(1, 2, 3);
Works on any codebase, level 0-8
tomasvotruba.com/blog/not-all-m…
I just want to say Abdul is very much a silent but huge part of the PHP community. He's been invaluable for managing Laravel Rector and @rectorphp itself.
If you love those tools he's a great person to sponsor.
260+ @phpstan rules live scattered across a dozen Github repos with patchy docs. Nobody finds them.
So I built one searchable page: plain-language descriptions + code examples for every rule. Find the one you need → automate it in CI 👇
tomasvotruba.com/blog/find-the-…
#phsptan pro tip for code that is not perfect yet (legacy, huge, growing, not on level 6, with 100+ ignores...)
If you want to get the most out of PHPStan, without going through 1000+ of reported errors of different types, start with one rule at a time.
"But how to do that? These levels so huge!"
1. disable the levels using "customRulesetUsed" magic word
2. start with effective rules like CallMethodsRule
This yields ~11 errors of one type our codebase (against 150+ on level 0)
I can fix it now. It brings instant value without stress.
It's easy to review, even if you're busy and your codebase has no tests.
Do you have more time? Add next rule the same way.
How to figure out how particular rule is called?
Just ask your favorite GPT :)
These are top 6 features of @symfony 8.1 I'd love to use 😍
🧵
Are you stuck on Symfony 1, 2 or 3...?
Let me know. We'll help you upgrade before next Symfony release 🚀
Inspired by these rules, we've added a brand new prepared set to @rectorphp - namedArgs 🎉🎉🎉
github.com/rectorphp/rect…
Release coming soon...
Any new rules that would deserve its place in the set? Keep them shipping ⬇️
Introducing CTOR: #PHPStan extension package to catch fake optional setters ↓
tomasvotruba.com/blog/introduci…
Useful for both legacy and modern codebases to improve latent object design.
Laravel Rector 2.4.0 just dropped 💪
We've got new contributors joining the project, which is always great to see.
Shoutout to @MrPunyapal for pushing the Attributes work forward. I'll have to cover this work in full another day, but it's very impressive.
AI often won't be aware of these changes, so if you want to apply them to your codebases, @rectorphp is by far the easiest way to do it consistently and correctly.
Again got chance to contribute to Laravel Rector package 📦
And now you can refactor almost all old ways to new attributes way in Laravel automatically 🙌💪
Laravel Rector 2.4.0 just dropped 💪
We've got new contributors joining the project, which is always great to see.
Shoutout to @MrPunyapal for pushing the Attributes work forward. I'll have to cover this work in full another day, but it's very impressive.
AI often won't be
Björn Brala @bbrala outlined how Drupal Rector uses structured transformation mappings to automate deprecated API rewrites, static analysis remediation, and scalable upgrade workflows across Drupal codebases.
bit.ly/4nJivIo#Drupal#Rector#PHP#Automation
PHP introduced `??` and `??=` years ago…
but I still see many developers stuck with ternary operators for default values 😅
Have you fully switched to null coalescing operators
or still using ternary out of habit? 👀
6K Followers 30 Following✍️ Writing a book about final solution to legacy https://t.co/ffWET1OvFW
😎 Upgrading PHP legacy projects
🤖 Automating PHP code with @rectorphp
4K Followers 1K FollowingSenior PHP Engineer via @ExploreAdeva | Building @codysseydev | Sharing Software Architecture and Design tips and tricks with PHP
1K Followers 370 Following🇵🇱 https://t.co/HerX32NWvo 🇬🇧 https://t.co/m6h4mNhOBh | Self-educated specialist: PHP, CI/CD, QA automation, Docker, Gitlab and more 😎. Member of @PHPCSFixer team 🪶.
95 Followers 5K FollowingMe gustan, la tecnología, los gadgets, el diseño inteligente. Amo: el basquetbol; cocinar; internarme un día entero en el cine; mi familia
260 Followers 2K FollowingHi, I'm a software developer with a passion for solving problems and building innovative solutions. I specialize in Backend Dev, looking for new challenges #web
1 Followers 61 FollowingPHP & high-performance systems lab. Exploring architectural limits by deconstructing and rebuilding web software from the ground up to scale under massive loads
6K Followers 30 Following✍️ Writing a book about final solution to legacy https://t.co/ffWET1OvFW
😎 Upgrading PHP legacy projects
🤖 Automating PHP code with @rectorphp