Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordpres.../vendor_p.../guzzleht.../promises/src
File: RejectedPromise.php
<?php
[0] Fix | Delete
[1] Fix | Delete
declare (strict_types=1);
[2] Fix | Delete
namespace YoastSEO_Vendor\GuzzleHttp\Promise;
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* A promise that has been rejected.
[6] Fix | Delete
*
[7] Fix | Delete
* Thenning off of this promise will invoke the onRejected callback
[8] Fix | Delete
* immediately and ignore other callbacks.
[9] Fix | Delete
*
[10] Fix | Delete
* @final
[11] Fix | Delete
*/
[12] Fix | Delete
class RejectedPromise implements \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface
[13] Fix | Delete
{
[14] Fix | Delete
private $reason;
[15] Fix | Delete
/**
[16] Fix | Delete
* @param mixed $reason
[17] Fix | Delete
*/
[18] Fix | Delete
public function __construct($reason)
[19] Fix | Delete
{
[20] Fix | Delete
if (\is_object($reason) && \method_exists($reason, 'then')) {
[21] Fix | Delete
throw new \InvalidArgumentException('You cannot create a RejectedPromise with a promise.');
[22] Fix | Delete
}
[23] Fix | Delete
$this->reason = $reason;
[24] Fix | Delete
}
[25] Fix | Delete
public function then(callable $onFulfilled = null, callable $onRejected = null) : \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface
[26] Fix | Delete
{
[27] Fix | Delete
// If there's no onRejected callback then just return self.
[28] Fix | Delete
if (!$onRejected) {
[29] Fix | Delete
return $this;
[30] Fix | Delete
}
[31] Fix | Delete
$queue = \YoastSEO_Vendor\GuzzleHttp\Promise\Utils::queue();
[32] Fix | Delete
$reason = $this->reason;
[33] Fix | Delete
$p = new \YoastSEO_Vendor\GuzzleHttp\Promise\Promise([$queue, 'run']);
[34] Fix | Delete
$queue->add(static function () use($p, $reason, $onRejected) : void {
[35] Fix | Delete
if (\YoastSEO_Vendor\GuzzleHttp\Promise\Is::pending($p)) {
[36] Fix | Delete
try {
[37] Fix | Delete
// Return a resolved promise if onRejected does not throw.
[38] Fix | Delete
$p->resolve($onRejected($reason));
[39] Fix | Delete
} catch (\Throwable $e) {
[40] Fix | Delete
// onRejected threw, so return a rejected promise.
[41] Fix | Delete
$p->reject($e);
[42] Fix | Delete
}
[43] Fix | Delete
}
[44] Fix | Delete
});
[45] Fix | Delete
return $p;
[46] Fix | Delete
}
[47] Fix | Delete
public function otherwise(callable $onRejected) : \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface
[48] Fix | Delete
{
[49] Fix | Delete
return $this->then(null, $onRejected);
[50] Fix | Delete
}
[51] Fix | Delete
public function wait(bool $unwrap = \true)
[52] Fix | Delete
{
[53] Fix | Delete
if ($unwrap) {
[54] Fix | Delete
throw \YoastSEO_Vendor\GuzzleHttp\Promise\Create::exceptionFor($this->reason);
[55] Fix | Delete
}
[56] Fix | Delete
return null;
[57] Fix | Delete
}
[58] Fix | Delete
public function getState() : string
[59] Fix | Delete
{
[60] Fix | Delete
return self::REJECTED;
[61] Fix | Delete
}
[62] Fix | Delete
public function resolve($value) : void
[63] Fix | Delete
{
[64] Fix | Delete
throw new \LogicException('Cannot resolve a rejected promise');
[65] Fix | Delete
}
[66] Fix | Delete
public function reject($reason) : void
[67] Fix | Delete
{
[68] Fix | Delete
if ($reason !== $this->reason) {
[69] Fix | Delete
throw new \LogicException('Cannot reject a rejected promise');
[70] Fix | Delete
}
[71] Fix | Delete
}
[72] Fix | Delete
public function cancel() : void
[73] Fix | Delete
{
[74] Fix | Delete
// pass
[75] Fix | Delete
}
[76] Fix | Delete
}
[77] Fix | Delete
[78] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function