Closed mpoiriert closed 1 year ago
Given you use PHPUnit, this plug-in might help you : https://plugins.jetbrains.com/plugin/9674-phpunit-enhancement/ 👍
@mpoiriert I don't know how phpstorm does this, you're saying we can add this to our project and it'll be found in the vendor folder?
@ciaranmcnulty Yes exactly. I tested it by putting this file manually in the vendor/phpspec/prophecy direcoty and it worked.
You can read about it here https://blog.jetbrains.com/phpstorm/2019/02/new-phpstorm-meta-php-features/
But the plugin that @sstok mention is working great. So it might be better to recommend it on the ream me documentation instead of adding the file...
PhpStorm handles Prophecy objects natively now (pretty well, not perfectly). I'm not sure what value that plugin adds. Maybe this issue can be closed.
No body seems to care and I am not using prophecy anymore so I will close it.
We indeed solved this by using generics, which makes it work for any static analysis tool supporting them instead of only solving it for phpstorm.
I am using PHPStorm and using prophecy (via PHPUnit) cause a lot of warning because on wrong argument when using the reveal return value directly.
What I end up doing it this:
To do this a bit "cleaner" a and using the phpstorm.meta this could be change to
This work but I have a warning because the reveal method doesn't have any argument.
Adding a file .phpstorm.meta.php with this would solve that