Problem/Motivation
Routing by PHP attributes was introduced in #3311365: Use PHP attributes for route discovery. This makes use of the Symfony\Component\Routing\Attribute\Route attribute class, and for a lot of routes, the title is defined like so:
#[Route(
// ...
defaults: ['_title' => new TranslatableMarkup('Basic site settings')],
)]
We could do some DX improvements with a Drupal subclass of Route that has title as a constructor property (likely typed to TranslatableMarkup, or maybe string|Stringable would be better, accounting for tests), and then make use of that attribute in route definitions.
It's best to come up with a comprehensive list of commonly used properties in Drupal routes that we can add to the class constructor, because adding named arguments later can make it complicated for contrib to do BC.
Comments
Comment #2
godotislateDupe of #3607968: Promote defaults._title to top level in route attributes.