You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the PHPStorm issue "Potentially polymorphic call. The code may be inoperable depending on the actual class instance passed as the argument"
Indeed, the method getContext() is not necessarily present in every possible Environment interface implementation since it is not declared in this interface. Actually it is declared in InitializedContextEnvironment only.
This might be solved by improving types based on the different scopes. The BeforeScenarioScope is guaranteed to get an environment implementing Behat\Behat\Context\Environment\ContextEnvironment, and I think even an InitializedContextEnvironment for that one (for BeforeSuite, that might not be an InitializedContextEnvironment, but it would still be a ContextEnvironment)
getContext public method is available only in specific ContextEnvironment implementations as it's not listed on the interface. FriendsOfBehat/SymfonyExtension implements that interface as well and provides getContext method additionally, but there's still no guarantee any other implementation will have that method.
The example about accessing contexts from each other triggers:
Indeed, the method
getContext()
is not necessarily present in every possibleEnvironment
interface implementation since it is not declared in this interface. Actually it is declared inInitializedContextEnvironment
only.The piece of code:
The text was updated successfully, but these errors were encountered: