Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/updraftp.../vendor/guzzleht.../promises/src
File: PromiseInterface.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace GuzzleHttp\Promise;
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* A promise represents the eventual result of an asynchronous operation.
[5] Fix | Delete
*
[6] Fix | Delete
* The primary way of interacting with a promise is through its then method,
[7] Fix | Delete
* which registers callbacks to receive either a promise’s eventual value or
[8] Fix | Delete
* the reason why the promise cannot be fulfilled.
[9] Fix | Delete
*
[10] Fix | Delete
* @link https://promisesaplus.com/
[11] Fix | Delete
*/
[12] Fix | Delete
interface PromiseInterface
[13] Fix | Delete
{
[14] Fix | Delete
const PENDING = 'pending';
[15] Fix | Delete
const FULFILLED = 'fulfilled';
[16] Fix | Delete
const REJECTED = 'rejected';
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Appends fulfillment and rejection handlers to the promise, and returns
[20] Fix | Delete
* a new promise resolving to the return value of the called handler.
[21] Fix | Delete
*
[22] Fix | Delete
* @param callable $onFulfilled Invoked when the promise fulfills.
[23] Fix | Delete
* @param callable $onRejected Invoked when the promise is rejected.
[24] Fix | Delete
*
[25] Fix | Delete
* @return PromiseInterface
[26] Fix | Delete
*/
[27] Fix | Delete
public function then(
[28] Fix | Delete
callable $onFulfilled = null,
[29] Fix | Delete
callable $onRejected = null
[30] Fix | Delete
);
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Appends a rejection handler callback to the promise, and returns a new
[34] Fix | Delete
* promise resolving to the return value of the callback if it is called,
[35] Fix | Delete
* or to its original fulfillment value if the promise is instead
[36] Fix | Delete
* fulfilled.
[37] Fix | Delete
*
[38] Fix | Delete
* @param callable $onRejected Invoked when the promise is rejected.
[39] Fix | Delete
*
[40] Fix | Delete
* @return PromiseInterface
[41] Fix | Delete
*/
[42] Fix | Delete
public function otherwise(callable $onRejected);
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Get the state of the promise ("pending", "rejected", or "fulfilled").
[46] Fix | Delete
*
[47] Fix | Delete
* The three states can be checked against the constants defined on
[48] Fix | Delete
* PromiseInterface: PENDING, FULFILLED, and REJECTED.
[49] Fix | Delete
*
[50] Fix | Delete
* @return string
[51] Fix | Delete
*/
[52] Fix | Delete
public function getState();
[53] Fix | Delete
[54] Fix | Delete
/**
[55] Fix | Delete
* Resolve the promise with the given value.
[56] Fix | Delete
*
[57] Fix | Delete
* @param mixed $value
[58] Fix | Delete
*
[59] Fix | Delete
* @throws \RuntimeException if the promise is already resolved.
[60] Fix | Delete
*/
[61] Fix | Delete
public function resolve($value);
[62] Fix | Delete
[63] Fix | Delete
/**
[64] Fix | Delete
* Reject the promise with the given reason.
[65] Fix | Delete
*
[66] Fix | Delete
* @param mixed $reason
[67] Fix | Delete
*
[68] Fix | Delete
* @throws \RuntimeException if the promise is already resolved.
[69] Fix | Delete
*/
[70] Fix | Delete
public function reject($reason);
[71] Fix | Delete
[72] Fix | Delete
/**
[73] Fix | Delete
* Cancels the promise if possible.
[74] Fix | Delete
*
[75] Fix | Delete
* @link https://github.com/promises-aplus/cancellation-spec/issues/7
[76] Fix | Delete
*/
[77] Fix | Delete
public function cancel();
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Waits until the promise completes if possible.
[81] Fix | Delete
*
[82] Fix | Delete
* Pass $unwrap as true to unwrap the result of the promise, either
[83] Fix | Delete
* returning the resolved value or throwing the rejected exception.
[84] Fix | Delete
*
[85] Fix | Delete
* If the promise cannot be waited on, then the promise will be rejected.
[86] Fix | Delete
*
[87] Fix | Delete
* @param bool $unwrap
[88] Fix | Delete
*
[89] Fix | Delete
* @return mixed
[90] Fix | Delete
*
[91] Fix | Delete
* @throws \LogicException if the promise has no wait function or if the
[92] Fix | Delete
* promise does not settle after waiting.
[93] Fix | Delete
*/
[94] Fix | Delete
public function wait($unwrap = true);
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function