Add type hints to all Search API interfaces/classes for Drupal 9

Created on 3 May 2019, over 6 years ago
Updated 24 August 2025, about 1 month ago

In 🌱 [Meta] Implement strict typing in existing code Active there is a discussion about the feasibility of adding comprehensive type hints to Core for Drupal 9.
At the moment, though, it doesn’t seem likely that this will happen.

However, in the Search API, on a much smaller scale, we’d still be free to make that same step, at least for all interfaces/classes/methods we introduce ourselves.
The question is: Should we do this? It would impact almost all related projects , even if the changes could probably be automated.
Plus, for the time that both Drupal 8 and 9 are supported, it would be necessary to maintain two distinct versions of the module, whereas it now looks as if the Drupal 8 and 9 versions of the module could be almost identical. (Or, at least, very much patch-compatible – something that will certainly not be true if we add type hints to almost every function and method.)

So, I’m looking for input, especially from module maintainers in the ecosystem: Do we want to do this?

🌱 Plan
Status

Active

Version

1.0

Component

Framework

Created by

🇦🇹Austria drunken monkey Vienna, Austria

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024