psalm-plugin-phpunit/stubs/Prophecy.phpstub
Bruce Weirdan 9c11bac834
Fix Prophecy-related issues
1. `prophesize()` has always been protected, not public
2. Provide generic definition for `prophesize()` implemented by `phpspec/prophecy-phpunit`
2020-08-24 22:32:11 +03:00

40 lines
943 B
Plaintext

<?php
namespace Prophecy\Prophecy {
/** @template T */
class ObjectProphecy implements ProphecyInterface
{
/** @return T */
public function reveal() {}
}
class MethodProphecy
{
public function willReturn(...$values): self {}
}
}
namespace Prophecy {
use Prophecy\Argument\Token;
class Argument
{
/** @param callable(mixed...):bool $callback */
public static function that(callable $callback): Token\CallbackToken {}
/** @param mixed ...$tokens */
public static function allOf(...$tokens): Token\LogicalAndToken {}
}
}
namespace Prophecy\PhpUnit {
use Prophecy\Prophecy\ObjectProphecy;
trait ProphecyTrait
{
/**
* @template T
* @param class-string<T> $classOrInterface
* @return ObjectProphecy<T>
*/
protected function prophesize($classOrInterface): ObjectProphecy {}
}
}