Run Rector on your code to see what it can do for you:
<?php namespace Symfony\Component\Routing\Annotation
class Foo { - /** - * @Route("/some/{id}", defaults={"id" = null}) - */ - public function indexAction() + #[Route(path: '/some/{id}', defaults: ['id' => 'null'])] + public function indexAction() { } } }
Applied Rules:
Not a change you expect?
rector.php