Add generics for the event subscriber configuration arrays and adapters #2851
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extracted from #2825
There is already an attempt to document the returned configs and event adapters in the event subscribers using
@method
annotations, but this can be quirky with IDEs (@method
is read as a virtual method as an example) and there were still some baseline PHPStan issues from the existing setup. This PR formalizes that through generics by providing templates for the config and adapter interfaces and updating each listener to fill those in (where that info already exists, there are a few extensions where a type for the config still needs to be generated so a generic array is still specified).