Drupal 11.5 introduces another significant step toward modern PHP development by allowing form routes to be defined directly on form classes using PHP attributes.
Until now, every custom form required a corresponding entry in a module's .routing.yml file. With this new feature, many of those YAML definitions can be eliminated, making code easier to maintain and keeping route configuration close to the class it belongs to.