Refactoring a large legacy PHP Application: a case study
summary
A ten‑year old PHP monolith with thousands of unused lines and procedural controllers gets incrementally reshaped: a critical mail parser (the Beast) is tested and refactored (first attempt breaks things because intent is unclear), arrays become domain objects like DealerConfig and Vehicle models, a small custom simple data mapper replaces Doctrine, a new API lives in an App Island, weekly training plus a technical debt board yields migrations, CI, Composer autoloading, and steady reduction of legacy cruft.
AI-written summary · about
chapters (22)
- 0:00Intro
- 1:06A bit of context
- 3:15"Living" Documentation
- 4:01Procedural code disguised as OO code No well established architecture No automated tests
- 8:20Mail parser aka "the beast"
- 9:27Pair programming on regular tasks
- 11:08Configuration system
- 19:40Code organization
- 21:24the code *must not use external code the code *must be tested
- 22:07Models + Repository Use Case
- 35:04Bad Idea: having 2 different approaches
- 35:24Code encapsulating business logic
- 38:05Use cases are no interchangeable
- 42:31Bad Idea: being optimist about preserving code quality
- 42:41Enforce good habits when developing
- 43:19Current directory structure was not clear enough
- 45:46Telemetry Controller Model Repository Use Case
- 47:10Testing
- 49:06Introducing big changes
- 54:42Eroding code from old controllers Identify Contexts
- 55:50Not everything can be rafactored
- 56:21Work on code and people
related talks
40mRefactoring Huge Legacy PHP Applications - From 100 hours to minutes
28mReformat, Refactor, Replace: A practical guide for dealing with legacy software
01h 02mRewriting 12-Year-Old Code
48mMigrating a 15 Year Old Enterprise Application to Laravel: Lessons Learned and Opportunities Gained
31mLearn to appreciate legacy
52mRefactoring to Symfony Components
43mOld code doesn't stink - Refactor or Rewrite
46mRewriting 15-Year-Old Code
