idea-php-phpunit-plugin
idea-php-phpunit-plugin copied to clipboard
Magic Prophecy methods should accept argument tokens for any argument
Currently, using a Prophecy argument token when writing a Prophecy mock triggers a warning about invalid type.
Instead, all magic mock method should have their arguments accepting their original argument type OR \Prophecy\Argument\Token\TokenInterface
Note that #12 is a subset of this case (specifically for one particular kind of token)
I have been issuing a similar problem with the folks at PHPStorm on their issue tracker and they referred me back to this plugin and we closed the issue as won't fix.
You can follow this issue here: https://youtrack.jetbrains.com/issue/WI-38593.
There is a sample project that I made that clarifies the situation where it shows that using Argument::any() or Argument::type(SomeClass::class) will trigger a warning. Like @stof said It would be nice if also Argument::type() would cleverly check for what is being given as argument in order to respect type hinting.
@Haehnchen any plan to work on a fix for this issue ?
Great stuff! Works really well.
Should I file a) one or b) two separate issues for the following?
- Argument::type('null')
- Argument::exact and Argument::is