Migrating a legacy PHP app to Composer

Part 2: Small, reversible steps

The codebase was older than two of the people maintaining it. Functions reached into globals, templates ran queries, and nobody wanted to touch the checkout file.

  • Add a static analysis baseline on day one
  • Type the boundaries before the internals
  • Keep hook names stable while moving callbacks
  • Delete dead code in its own commit

10 comments on “Migrating a legacy PHP app to Composer”

  1. We tried something similar last year and gave up halfway. Seeing it laid out step by step makes me want to try again.

      1. Jonah Whitfield

        Fair point, and thanks for the thoughtful disagreement. It really depends on the size of the team.

        1. Jonah Whitfield

          Good question. It took about three weeks, most of it waiting for review and measuring the results.

    1. Jonah Whitfield

      Fair point, and thanks for the thoughtful disagreement. It really depends on the size of the team.

    2. Jonah Whitfield

      Fair point, and thanks for the thoughtful disagreement. It really depends on the size of the team.

Leave a comment

Your email address will not be published. Required fields are marked *