mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Add ideal stub return types
This commit is contained in:
parent
b0d97843ce
commit
d18ef9c6e1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user