1
0
mirror of https://github.com/danog/amp.git synced 2024-12-12 09:29:45 +01:00
amp/lib/Internal/PrivatePromise.php
Aaron Piotrowski d48e6bd5d2
Add more class and return types
More PHP 7.1 to 8 types added.
2020-09-24 22:17:13 -05:00

25 lines
508 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
{
private Promise $promise;
public function __construct(Promise $promise)
{
$this->promise = $promise;
}
public function onResolve(callable $onResolved): void
{
$this->promise->onResolve($onResolved);
}
}