Add parameter and return type hints to all test methods

Created on 6 February 2023, about 2 years ago
Updated 15 February 2023, about 2 years ago

The return type hints are required for the test setUp() methods in Drupal 10, because Drupal core added these hints. And it does not hurt to add them in Drupal 9. But this is not compatible with Drupal 8 because Drupal 8 supports versions of PHP that do not understand these type hints.

Additionally, we should start to use strong typing whenever possible, so when we add the return type hints for the test setUp() methods we should also add return type hints to all other test methods and method parameters. Adding these hints to non-test methods may represent an API change in some cases so these should be done in separate issue with a proper BC layer if necessary. But the test methods are safe to change now.

This requires support for Drupal 8 to be dropped.

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024