When a prophecy is used in the same method, the plugin seems to help PhpStorm understand that the return types of the mocked object are actually returning method prophecies, as autocomplete works fine, and there are no complaints about the method:
However, if the ObjectProphecy is returned from another method, PhpStorm complains about something. When returning with no type declaration:
Here the complaint is Method 'willReturn' not found in bool
Declaring ObjectProphecy as the return type:
Here the complaint is Method 'isEnterprise' not found in \Prophecy\Prophecy\ObjectProphecy
Declaring ObjectProphecy as the return type and annotating @return ObjectProphecy|MemberSubscription:
Same complaint about it being a bool.
A hacky workaround is just adding this line (even though the variable is never used, as it's redefined later in the method), but then all the complaints go away:
(And of course the EA plugin complains about that)
When a prophecy is used in the same method, the plugin seems to help PhpStorm understand that the return types of the mocked object are actually returning method prophecies, as autocomplete works fine, and there are no complaints about the method:
However, if the
ObjectProphecy
is returned from another method, PhpStorm complains about something. When returning with no type declaration:Here the complaint is![image](https://user-images.githubusercontent.com/125074/90655519-ae026200-e20f-11ea-8918-2f0a87ae3968.png)
Method 'willReturn' not found in bool
Declaring
ObjectProphecy
as the return type:Here the complaint is![image](https://user-images.githubusercontent.com/125074/90655690-db4f1000-e20f-11ea-9e5d-81b37a9b869d.png)
Method 'isEnterprise' not found in \Prophecy\Prophecy\ObjectProphecy
Declaring
ObjectProphecy
as the return type and annotating@return ObjectProphecy|MemberSubscription
:Same complaint about it being a![image](https://user-images.githubusercontent.com/125074/90655853-15b8ad00-e210-11ea-96d5-1173e1b1681f.png)
bool
.A hacky workaround is just adding this line (even though the variable is never used, as it's redefined later in the method), but then all the complaints go away:
(And of course the EA plugin complains about that)![image](https://user-images.githubusercontent.com/125074/90657131-8fe93180-e210-11ea-9a7e-4bb61b2d28d5.png)