In order to have autocompletion/static analysis we often have added an assert()
after a call to EventDispatcherInterface::dispatch
.
For the static analysis part, Psalm does not need it anymore, we introduced a stub for it a while ago.
For the IDE autocompletion, we can hint Jetbrains tools what's the actual type of the returned value by defining a specific override in a .phpstorm.meta.php
file.