1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Add ideal stub return types

This commit is contained in:
Matthew Brown 2019-02-06 09:14:02 -05:00
parent b0d97843ce
commit d18ef9c6e1

View File

@ -11,11 +11,12 @@ function coroutine(callable $gen) : Promise {}
/**
* @template TReturn
* @param callable():(\Generator<mixed, mixed, mixed, TReturn>|null) $gen
* @param callable():(\Generator<mixed, mixed, mixed, TReturn>|TReturn) $gen
* @return Promise<TReturn>
*/
function call(callable $gen) : Promise {}
/**
* @template TReturn
*/
@ -33,6 +34,10 @@ interface Promise {
* @template-implements Promise<TReturn>
*/
class Success implements Promise {
/**
* @param TReturn|null $value
*/
public function __construct($value = null) {}
/**
* @param callable(\Throwable|null $exception, TReturn|null $result):void
* @return void