Slide 1

Slide 1 text

Switching off legacy code using one Symfony command at a time

Slide 2

Slide 2 text

Greetings

Slide 3

Slide 3 text

Hellcome Guillaume Loulier / @Guikingone Lead developer @SensioLabs Works mainly with PHP and Rust Sometimes, I break things, especially legacy ones (and I like that)

Slide 4

Slide 4 text

Summary 01 - Legacy code is fun 02 - Migrating, a far far away dream 04 - Symfony to the rescue 05 - Wrapping up 01

Slide 5

Slide 5 text

Legacy code is fun

Slide 6

Slide 6 text

Well, it should

Slide 7

Slide 7 text

Diving into the joke Refu*toring - The process of taking a well-designed piece of code and, through a series of small, reversible changes, making it completely unmaintainable by anyone except yourself. Jason Gorman

Slide 8

Slide 8 text

Let the fun begin A legacy code is just an abandoned one that generate revenues Maintaining legacy code should be easy At least, until it breaks Never needed to migrate PHP 5 code?

Slide 9

Slide 9 text

Dealing with technical debt Technical debt is ambiguous Yesterday code is already outdated, sorry Need to migrate it? Bon chance

Slide 10

Slide 10 text

Keep dreamin’

Slide 11

Slide 11 text

I made a dream

Slide 12

Slide 12 text

Time for a wishlist Tracking, being aware of changes, updating and deleting A new interface? For which use case? What about this method arguments type? Code spread across repositories?

Slide 13

Slide 13 text

Sadly What about using a dedicated channel? Or using trigger_error? Or tools like Sentry, OpenTelemetry and many more? What if we’re in a special architecture?

Slide 14

Slide 14 text

Symfony?

Slide 15

Slide 15 text

Well…

Slide 16

Slide 16 text

The full experience Symfony brings a lot of components Could we bring them together to help us? Look at Rector, PHPStan and more! What if we could “track & switch off” files?

Slide 17

Slide 17 text

Time to “Switchoff” Built on top of Symfony components and nikic/PHP-Parser (chief kiss) Attributes for the win! Analyze, check, switch off, repeat Could be used via the CLI / CI

Slide 18

Slide 18 text

Want a demo?

Slide 19

Slide 19 text

What’s next?

Slide 20

Slide 20 text

To sum it up Handling migration is hard, not to say boring Symfony could ease the process but lack of tools Relying on a framework is a recipe for failure Each project has its own rules / flaws

Slide 21

Slide 21 text

What about switchoff? Not fully stable (for now) A Symfony bundle? (Already planned) An HTML dashboard What about a PHPStan / Rector bridge?

Slide 22

Slide 22 text

Wrapping up