Amp\Promise\adapt

functionadapt(object$promise):Amp\Promise

Adapts any object with a done(callable $onFulfilled, callable $onRejected) or then(callable $onFulfilled, callable $onRejected) method to a promise usable by components depending on placeholders implementing \AsyncInterop\Promise.

Type Parameter Description Default Value
object $promise Object with a done() or then() method. none