(next) How to Instantly Upgrade your Legacy Symfony in Minutes?
Tomas Votruba
@votrubat
@rectorphp
Thank You 🙏
for Coming
Hi, I'm Tomas...
...and I love legacy code 😍
notes 2024-02-02
new rector 0.19 php version set - no need to specify
add type coverage as you go
let rector handle the upgrade
show custom rule to change laravel 10 sth
notes 2024-02-02
new rector 0.19 php version set - no need to specify
add type coverage as you go
let rector handle the upgrade
show custom rule to change laravel 10 sth
notes 2024-02-02
new rector 0.19 php version set - no need to specify
add type coverage as you go
let rector handle the upgrade
show custom rule to change laravel 10 sth
What you Learn? 🤔
-
how to upgrade Symfony quickly
-
guide to sustainable code
-
tips for extreeeemely lazy devs
-
best practises for easy change
-
demo 🧑💻
3 Years 😷 Later...
What is your Version?
(my guess)
Bad News 😢
-
extra work every 6 months
-
double the work every 12 months
-
boring work
-
BC breaks
-
repeated work
Good News 😊
-
all code base are the same
-
MVC
-
features
-
input → output
-
there are patterns
House Reconstruction?
-
we need plan and design
-
layers in right order
-
have the tooling
-
use the tooling well
-
get the right people
"Go Fast, Go Alone
Go Far, Go together"
1. The Right Tooling
-
Coding Standards
-
PHPStan
-
Type Coverage
-
Rector
2. Plan The Order
Symfony 2.8
-
PHP 7.2
-
PHP 7.3
-
PHP 7.4
-
Symfony 3.0
-
Symfony 3.1 ...
3. Patch Around 😎
- clean /vendor, but in newer version
- symplify/vendor-patches
💻
💻
4. Lean Iterate
-
The smallest PR ever
-
Work is always finished
-
1 rule at a time, don't be a hero
-
Merge as fast as... Elon Musk fires people: 0, max 1 day
5. Type Coverage
-
3 types of "typed-code"
-
no types
-
doc types
-
type declarations
-
💻
💻
5. Type Coverage
-
measure it
-
put it in CI
-
at least 80-90 % are you're in amazing shape 💪
💻
6. PHPStan Level
-
at least level 4
-
types first
💻
No Baseline!
7. No YAML
-
from dummy string to context
-
use PHP awesome treesome
-
ECS
-
PHPStan
-
Rector
-
💻
💻
Also Slim Configs
-
no tags
-
autoconfigure
-
PSR-4 autodiscovery
-
move as much as you can away
8. The Last Upgrade
-
solve it today, and forget it forever
-
the same work in 2 years?
-
let CI upgrade for you
-
2 lines in code
-
💻
<Put DEMO here>
💻
9. Power of Community
-
new PHP? → add a rule
-
new Symfony? → add a rule
-
new PHPUnit? → add a rule
10. The Senior Dev Code
-
teach other devs
-
move responsibility from people to the CI
-
cooperate together
-
open hands to develpers to work effectively
"How many people is needed to maintain company with single form?"
"How many people is needed to maintain company with single form?"
Now 3500 less...
11. Be Competetive
-
grow
-
be balsy
-
try new tools
-
ask for engaging work only
12. Ask for Best Quality
-
no type changes
-
no boring work
-
no repeated work
-
let Rector work for you so...
-
...you can refactor and improve code
Create Meaninful
Code you'll Love ❤️️
Thank you 🙏
Slides + demo on @votrubaT today
Copy of deck
By Tomáš Votruba
Copy of deck
- 514