PHP Attributes can be used for route definition and discovery
Starting with Drupal 11.4.0, you can now use attributes on your controllers to specify the routes the controller is used for. Any classes in a module's Controller namespace (for example, Drupal\example\Controller) that have the Symfony\Component\Routing\Attribute\Route attribute will be picked up as route definitions. This supplements the existing .routing.yml based