Symfony 2 → 8
Symfony Upgrade Service: from Symfony 2 to Symfony 8
Symfony ships a deprecation layer for every major version. We use it: Rector rewrites your code to the new API before the old one disappears, one major version at a time, with tests green on every step.
Typical blockers
What stops a Symfony upgrade
- YAML and XML service configs that no longer load, controllers extending removed base classes
- Annotations for routes, Doctrine and validation that need to become PHP 8 attributes
- Forms, events, security and the messenger component changed their APIs across majors
- Third-party bundles abandoned somewhere between Symfony 3 and 5, blocking the composer update
How we do it
Step by step, always mergeable
- Intro analysis: we map every bundle, config format and deprecated API and tell you which majors are cheap and which one hides the real work.
- Move configs to PHP, controllers to constructor injection and annotations to attributes with Rector Symfony sets, before bumping a single version.
- Bump Symfony one major at a time. Composer-based sets pick the right rules for the exact version in your composer.json.
- Replace or fork abandoned bundles, then hand over a project on the latest LTS with Rector in CI.
What the diff looks like
Every change is a reviewable diff, small enough to merge the same day.
-/**
- * @Route("/order/{id}", name="order_detail")
- */
-public function detail($id, Request $request)
-{
- $order = $this->get('doctrine')
- ->getRepository(Order::class)
- ->find($id);
-
- return $this->render('order.html.twig', ['order' => $order]);
-}
+#[Route('/order/{id}', name: 'order_detail')]
+public function detail(int $id): Response
+{
+ $order = $this->orderRepository->find($id);
+
+ return $this->render('order.html.twig', ['order' => $order]);
+}
“Tomas' deep expertise and tools-driven approach allowed us to modernize a significantly large legacy PHP codebase while teaching us best practices. Rector team worked around our schedule to ensure minimal disruption. I highly recommend Rector team for legacy PHP code modernization!”
Eric Molitor
CTO at Curve
Intro analysis
2 weeks, $6,000-8,000
Codebase measured, blockers listed, timeline and price for the whole upgrade in a PDF report.
Hands-on upgrade
$120 / hour
20-80 hours a week, in parallel to your team, every change delivered as a mergeable pull request.
Do it yourself
Open source
Browse Symfony Rector rules and read the documentation to run the upgrade with your own team.