Change record status: 
Project: 
Introduced in branch: 
11.4.x
Introduced in version: 
11.4.0
Description: 

The #[MapQueryParameters] attribute from Symfony is now supported in Drupal. Controllers that access query string parameters can now declare them directly in the method signature instead of having to read them from the request.

Before:

  public function setDefaultTheme(Request $request) {
    $theme = $request->query->get('theme');

After:

  public function setDefaultTheme(#[MapQueryParameter] string $theme) {

Mapped arguments can be typed, validated, and nullable or provide default values where this is needed. See the Symfony documentation for more details.

Impacts: 
Module developers