Package sensio/framework-extra-bundle is abandoned

Package sensio/framework-extra-bundle is abandoned

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Migrating from sensio/framework-extra-bundle to Native Symfony Routing

When upgrading a Symfony application, specifically moving from version 6.1 to 6.2, you may encounter a deprecation notice regarding the sensio/framework-extra-bundle. Composer explicitly warns that this package is abandoned and advises switching to native Symfony functionality. If you simply deleted the package without adjusting your configuration, your routing system will likely break immediately upon restarting the server. This guide explains how to migrate from the bundle to Symfony's built-in support for route attributes and controller arguments.

The sensio/framework-extra-bundle was historically necessary because early versions of Symfony lacked native support for defining routes directly within controller files using attributes like #[Route]. Instead, routes were defined in YAML or XML configuration files, and controllers relied on annotations to declare request parameters. The bundle bridged this gap by injecting a service that processed these annotations at runtime.

Symfony 6.1 introduced experimental support for route attributes, and by Symfony 6.2, this capability became the standard. The abandonment of sensio/framework-extra-bundle is not about removing functionality but rather about consolidating features into the core framework to reduce dependencies and improve performance. When you remove the bundle, you lose the magic that automatically mapped annotations to route definitions. Consequently, any controller method annotated with @Route or expecting arguments via annotation-based injection will fail unless migrated.

Identifying Affected Controllers

Before removing the package, scan your application for controllers using the legacy annotation syntax. Look specifically for:

  1. Methods decorated with @Route(path="...").
  2. Arguments defined with @RequestParam, @QueryParameter, or similar annotations expecting type hints that were previously handled by the bundle's argument resolver.

If you have already deleted the package and are facing 404 errors or route resolution failures, these are the files requiring attention. You must replace the annotation-based definitions with PHP attributes.

Migrating to Native Attributes

The migration process involves replacing annotations with their attribute counterparts. Symfony's router now natively handles #[Route], #[ParamConverter], and other routing-related decorators.

Consider a controller method from a legacy application:

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request;

class SomeController
{
    /**
     * @Route("/users/{id}", name="user_show")
     */
    public function show(Request $request, int $id)
    {
        // Logic here
    }
}

This code will stop working once sensio/framework-extra-bundle is removed. The equivalent implementation using native attributes looks like this:

use Symfony\Component\Routing\Annotation\Route;
// Note: In modern Symfony, @Route was moved to the Annotation namespace 
// but attributes are preferred. Use #[Route] syntax.

class SomeController
{
    #[Route(path: '/users/{id}', name: 'user_show')]
    public function show(Request $request, int $id): Response
    {
        // Logic here
    }
}

Handling Argument Conversion

One of the most common pitfalls during this migration is the handling of argument conversion. The sensio/framework-extra-bundle supported the @ParamConverter annotation to load Doctrine entities or other objects before they were passed to the controller. In Symfony 6.2, the ParamConverter component has been integrated into the core, but the approach shifts slightly.

Instead of using the #[ParamConverter] attribute directly on the argument in older configurations, you should ensure your controllers are compatible with the new event dispatcher or explicitly use the #[Map] attribute if available in your specific Symfony version, or simply rely on type hints if the default resolver is sufficient. However, for Doctrine entities, the standard approach now involves using the #[ParamConverter] attribute from Symfony\Component\Routing\Attribute (or similar depending on exact minor version nuances) or utilizing the dedicated service container configuration if complex mapping rules are needed.

In many cases, simple type hints like int $id work out of the box because Symfony automatically converts string query parameters to integers. If you relied heavily on custom converters, ensure you have registered them in your services.yaml or that the native resolver handles your specific needs without the bundle's intervention.

Updating Configuration

If your project utilized configuration files to define routes alongside the annotations, verify that these definitions are still valid. Often, teams used the bundle to allow both annotation and YAML coexistence. Once migrated, you can choose to keep the YAML routes for consistency or rely entirely on attributes defined in the controller classes. Attributes defined in the code take precedence if conflicts arise, but a clean slate often yields better performance as it removes the overhead of scanning annotations that are no longer needed.

By following these steps, you align your application with Symfony's current architecture, eliminating an abandoned dependency and leveraging the robust routing system built into the framework itself.

Our network