1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 10:57:08 +01:00
psalm/src/Psalm/Internal/Stubs/Amp.php
Matthew Brown da42be175f Apply PHPCS fixes
Fixes #1880
2019-07-05 16:27:53 -04:00

62 lines
997 B
PHP

<?php
namespace Amp;
/**
* @template TReturn
*
* @param callable():\Generator<mixed, mixed, mixed, TReturn> $gen
*
* @return callable():Promise<TReturn>
*/
function coroutine(callable $gen) : callable
{
}
/**
* @template TReturn
*
* @param callable():(\Generator<mixed, mixed, mixed, TReturn>|TReturn) $gen
*
* @return Promise<TReturn>
*/
function call(callable $gen) : Promise
{
}
/**
* @template TReturn
*/
interface Promise
{
/**
* @param callable(?\Throwable, ?TReturn):void $onResolved
*
* @return void
*/
public function onResolve(callable $onResolved);
}
/**
* @template TReturn
*
* @template-implements Promise<TReturn>
*/
class Success implements Promise
{
/**
* @param TReturn|null $value
*/
public function __construct($value = null)
{
}
/**
* @param callable(?Throwable, ?TReturn):void $onResolved
*
* @return void
*/
public function onResolve(callable $onResolved)
{
}
}