PluginProbe ʕ •ᴥ•ʔ
Check & Log Email – Easy Email Testing & Mail logging / 2.0.16
Check & Log Email – Easy Email Testing & Mail logging v2.0.16
2.0.16 2.0.15 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.13.2 2.0.14 2.0.2 2.0.3 2.0.4 2.0.5 2.0.5.1 2.0.6 2.0.7 2.0.8 2.0.9 trunk 0.5.7 0.6.0 0.6.1 0.6.2 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.12.1 1.0.13 1.0.13.1 1.0.2 1.0.3
check-email / vendor / guzzlehttp / promises / src / PromiseInterface.php
check-email / vendor / guzzlehttp / promises / src Last commit date
AggregateException.php 5 days ago CancellationException.php 5 days ago Coroutine.php 5 days ago Create.php 5 days ago Each.php 5 days ago EachPromise.php 5 days ago FulfilledPromise.php 5 days ago Is.php 5 days ago Promise.php 5 days ago PromiseInterface.php 5 days ago PromisorInterface.php 5 days ago RejectedPromise.php 5 days ago RejectionException.php 5 days ago TaskQueue.php 5 days ago TaskQueueInterface.php 5 days ago Utils.php 5 days ago
PromiseInterface.php
92 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace GuzzleHttp\Promise;
6
7 /**
8 * A promise represents the eventual result of an asynchronous operation.
9 *
10 * The primary way of interacting with a promise is through its then method,
11 * which registers callbacks to receive either a promise’s eventual value or
12 * the reason why the promise cannot be fulfilled.
13 *
14 * @see https://promisesaplus.com/
15 */
16 interface PromiseInterface
17 {
18 public const PENDING = 'pending';
19 public const FULFILLED = 'fulfilled';
20 public const REJECTED = 'rejected';
21
22 /**
23 * Appends fulfillment and rejection handlers to the promise, and returns
24 * a new promise resolving to the return value of the called handler.
25 *
26 * @param callable $onFulfilled Invoked when the promise fulfills.
27 * @param callable $onRejected Invoked when the promise is rejected.
28 */
29 public function then(
30 ?callable $onFulfilled = null,
31 ?callable $onRejected = null
32 ): PromiseInterface;
33
34 /**
35 * Appends a rejection handler callback to the promise, and returns a new
36 * promise resolving to the return value of the callback if it is called,
37 * or to its original fulfillment value if the promise is instead
38 * fulfilled.
39 *
40 * @param callable $onRejected Invoked when the promise is rejected.
41 */
42 public function otherwise(callable $onRejected): PromiseInterface;
43
44 /**
45 * Get the state of the promise ("pending", "rejected", or "fulfilled").
46 *
47 * The three states can be checked against the constants defined on
48 * PromiseInterface: PENDING, FULFILLED, and REJECTED.
49 */
50 public function getState(): string;
51
52 /**
53 * Resolve the promise with the given value.
54 *
55 * @param mixed $value
56 *
57 * @throws \RuntimeException if the promise is already resolved.
58 */
59 public function resolve($value): void;
60
61 /**
62 * Reject the promise with the given reason.
63 *
64 * @param mixed $reason
65 *
66 * @throws \RuntimeException if the promise is already resolved.
67 */
68 public function reject($reason): void;
69
70 /**
71 * Cancels the promise if possible.
72 *
73 * @see https://github.com/promises-aplus/cancellation-spec/issues/7
74 */
75 public function cancel(): void;
76
77 /**
78 * Waits until the promise completes if possible.
79 *
80 * Pass $unwrap as true to unwrap the result of the promise, either
81 * returning the resolved value or throwing the rejected exception.
82 *
83 * If the promise cannot be waited on, then the promise will be rejected.
84 *
85 * @return mixed
86 *
87 * @throws \LogicException if the promise has no wait function or if the
88 * promise does not settle after waiting.
89 */
90 public function wait(bool $unwrap = true);
91 }
92