PhpStorm: annotation for inherited method return type?
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 5 years ago . Using a Behat sub-context class I need to call a method from the main context, e.g. $this->getMainContext()->fooBar() . PhpStorm quite reasonably warns me that fooBar() doesn't exist, because it expects getMainContext() to return an ExtendedContextInterface , not my concrete FeatureContext . Is there a way to annotate my sub-class to tell PhpStorm that getMainContext() actually