PHP 8.2.31
Preview: Deferred.php Size: 1.04 KB
/opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/react/promise/src/Deferred.php

<?php

namespace RectorPrefix202411\React\Promise;

/**
 * @template T
 */
final class Deferred
{
    /**
     * @var PromiseInterface<T>
     */
    private $promise;
    /** @var callable(T):void */
    private $resolveCallback;
    /** @var callable(\Throwable):void */
    private $rejectCallback;
    /**
     * @param (callable(callable(T):void,callable(\Throwable):void):void)|null $canceller
     */
    public function __construct(?callable $canceller = null)
    {
        $this->promise = new Promise(function ($resolve, $reject) : void {
            $this->resolveCallback = $resolve;
            $this->rejectCallback = $reject;
        }, $canceller);
    }
    /**
     * @return PromiseInterface<T>
     */
    public function promise() : PromiseInterface
    {
        return $this->promise;
    }
    /**
     * @param T $value
     */
    public function resolve($value) : void
    {
        ($this->resolveCallback)($value);
    }
    public function reject(\Throwable $reason) : void
    {
        ($this->rejectCallback)($reason);
    }
}

Directory Contents

Dirs: 2 × Files: 5

Name Size Perms Modified Actions
Exception DIR
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
Internal DIR
- drwxr-xr-x 2024-11-08 13:59:10
Edit Download
1.04 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
11.17 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
152 B lrw-r--r-- 2024-11-08 13:59:10
Edit Download
10.03 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download
5.61 KB lrw-r--r-- 2024-11-08 13:59:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).