cii-text-analysis/vendor/amphp/amp/lib/Internal/PrivatePromise.php
Jéremy Munsch f68d2ac333
premier poc
2026-02-11 08:24:04 +01:00

25 lines
518 B
PHP

<?php
namespace Amp\Internal;
use Amp\Promise;
/**
* Wraps a Promise instance that has public methods to resolve and fail the promise into an object that only allows
* access to the public API methods.
*/
final class PrivatePromise implements Promise
{
/** @var Promise */
private $promise;
public function __construct(Promise $promise)
{
$this->promise = $promise;
}
public function onResolve(callable $onResolved)
{
$this->promise->onResolve($onResolved);
}
}