Since version 5.2, routing annotations from SensioFrameworkExtraBundle are deprecated because routing is now a core Symfony feature. To update your application, change the namespace of the Route annotation from Sensio\Bundle\FrameworkExtraBundle\Configuration\Route to Symfony\Component\Routing\Annotation\Route.
Note that Symfony's @Route annotation no longer supports the service option. In modern Symfony, controllers are services by default using their fully-qualified class names, making the service option obsolete.
// Before
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
// After
use Symfony\Component\Routing\Annotation\Route;
class DefaultController extends Controller
{
/**
* @Route("/")
*/
public function index()
{
// ...
}
}