Haehnchen / idea-php-phpunit-plugin

IntelliJ IDEA / PhpStorm PHPUnit Enhancement Plugin
MIT License
55 stars 11 forks source link

support Argument::any (Prophecy\Argument\Token\TokenInterface) type resolving based on prophecy class context #12 #29 #47

Closed Haehnchen closed 4 years ago

stof commented 4 years ago

This fixes #12 but not #29 as it does not support all tokens.

daniele-xp commented 4 years ago

Thank you @stof !

I confirm that the problem is resolved with some token (eg. no more PhpStrictTypeCheckingInspection warnings using Argument::any())

$this->calculatorMock
    ->square(Argument::any())
    ->willReturn(64);

but different warnings still remain (eg. PhpParamsInspection passing only Argument::cetera() in a method with multiple arguments)

/** @noinspection PhpParamsInspection */
$this->calculatorMock
    ->add(Argument::cetera())
    ->willReturn(42);

It's a big improvement anyway! :clap: