mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-11-26 12:04:52 +01:00
9c11bac834
1. `prophesize()` has always been protected, not public 2. Provide generic definition for `prophesize()` implemented by `phpspec/prophecy-phpunit`
40 lines
943 B
Plaintext
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 {}
|
|
}
|
|
}
|