Change record status: 
Project: 
Introduced in branch: 
9.3.x
Introduced in version: 
9.3.0
Description: 

Return type hints have been added to some methods of some classes for compatibility with Symfony 5.4 and Symfony 6.

We have only added return type hints where:

  • The return type is compatible with PHP 7.3 (i.e. no union or static) types.
  • There are no examples of contributed modules overriding the method

More return type hints will be added in Drupal 10.

Should you have custom code that overrides one of these methods, adding a return type hint will be compatible with Drupal 9.2.x versions of the code too, due to PHP covariance.

Impacts: 
Module developers