1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00
amp/stubs/Continuation.php
2020-11-05 11:29:31 -06:00

33 lines
827 B
PHP

<?php
final class Continuation
{
/**
* @return bool True if either {@see resume()} or {@see throw()} has been called previously.
*/
public function continued(): bool { }
/**
* Resumes the fiber, returning the given value from {@see Fiber::suspend()}.
*
* @param mixed $value
*
* @throw FiberError If the continuation has already been used.
*/
public function resume(mixed $value = null): void { }
/**
* Throws the given exception into the fiber from {@see Fiber::suspend()}.
*
* @param Throwable $exception
*
* @throw FiberError If the continuation has already been used.
*/
public function throw(Throwable $exception): void { }
/**
* Cannot be constructed by user code.
*/
private function __construct() { }
}