mirror of
https://github.com/danog/amp.git
synced 2025-01-22 21:31:18 +01:00
Fix Psalm errors
This commit is contained in:
parent
0ddf9a656e
commit
3fb87e2c18
@ -12,7 +12,7 @@ final class AsyncGenerator implements Stream
|
||||
/** @var Internal\EmitSource<TValue, TSend> */
|
||||
private $source;
|
||||
|
||||
/** @var Promise<TReturn> */
|
||||
/** @var Coroutine<TReturn>|null */
|
||||
private $coroutine;
|
||||
|
||||
/** @var \Generator|null */
|
||||
@ -121,11 +121,16 @@ final class AsyncGenerator implements Stream
|
||||
return $this->coroutine;
|
||||
}
|
||||
|
||||
/** @psalm-suppress PossiblyNullArgument */
|
||||
$this->coroutine = new Coroutine($this->generator);
|
||||
$this->generator = null;
|
||||
|
||||
$source = $this->source;
|
||||
$this->coroutine->onResolve(static function ($exception) use ($source) {
|
||||
if ($source->isComplete()) {
|
||||
return; // AsyncGenerator object was destroyed.
|
||||
}
|
||||
|
||||
if ($exception) {
|
||||
$source->fail($exception);
|
||||
return;
|
||||
|
@ -43,6 +43,7 @@ final class Deferred
|
||||
*/
|
||||
public function isResolved(): bool
|
||||
{
|
||||
/** @psalm-suppress UndefinedInterfaceMethod */
|
||||
return $this->resolver->isResolved();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user