phpstan-mockery icon indicating copy to clipboard operation
phpstan-mockery copied to clipboard

Mockery::spy(function) should be callable

Open LastDragon-ru opened this issue 4 years ago • 1 comments
trafficstars

https://phpstan.org/r/4d0416f7-0b46-471e-b961-a685a5fab277

Current versions report an error

Parameter #1 $callback of static method Closure::fromCallable() expects callable(): mixed, Mockery\MockInterface given.

LastDragon-ru avatar Aug 08 '21 12:08 LastDragon-ru

Can be solved with a dynamic return type extension: https://phpstan.org/developing-extensions/dynamic-return-type-extensions

Feel free to contribute it :)

ondrejmirtes avatar Aug 12 '21 13:08 ondrejmirtes