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: Create.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
final class Create
[5] Fix | Delete
{
[6] Fix | Delete
/**
[7] Fix | Delete
* Creates a promise for a value if the value is not a promise.
[8] Fix | Delete
*
[9] Fix | Delete
* @param mixed $value Promise or value.
[10] Fix | Delete
*/
[11] Fix | Delete
public static function promiseFor($value) : \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface
[12] Fix | Delete
{
[13] Fix | Delete
if ($value instanceof \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface) {
[14] Fix | Delete
return $value;
[15] Fix | Delete
}
[16] Fix | Delete
// Return a Guzzle promise that shadows the given promise.
[17] Fix | Delete
if (\is_object($value) && \method_exists($value, 'then')) {
[18] Fix | Delete
$wfn = \method_exists($value, 'wait') ? [$value, 'wait'] : null;
[19] Fix | Delete
$cfn = \method_exists($value, 'cancel') ? [$value, 'cancel'] : null;
[20] Fix | Delete
$promise = new \YoastSEO_Vendor\GuzzleHttp\Promise\Promise($wfn, $cfn);
[21] Fix | Delete
$value->then([$promise, 'resolve'], [$promise, 'reject']);
[22] Fix | Delete
return $promise;
[23] Fix | Delete
}
[24] Fix | Delete
return new \YoastSEO_Vendor\GuzzleHttp\Promise\FulfilledPromise($value);
[25] Fix | Delete
}
[26] Fix | Delete
/**
[27] Fix | Delete
* Creates a rejected promise for a reason if the reason is not a promise.
[28] Fix | Delete
* If the provided reason is a promise, then it is returned as-is.
[29] Fix | Delete
*
[30] Fix | Delete
* @param mixed $reason Promise or reason.
[31] Fix | Delete
*/
[32] Fix | Delete
public static function rejectionFor($reason) : \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface
[33] Fix | Delete
{
[34] Fix | Delete
if ($reason instanceof \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface) {
[35] Fix | Delete
return $reason;
[36] Fix | Delete
}
[37] Fix | Delete
return new \YoastSEO_Vendor\GuzzleHttp\Promise\RejectedPromise($reason);
[38] Fix | Delete
}
[39] Fix | Delete
/**
[40] Fix | Delete
* Create an exception for a rejected promise value.
[41] Fix | Delete
*
[42] Fix | Delete
* @param mixed $reason
[43] Fix | Delete
*/
[44] Fix | Delete
public static function exceptionFor($reason) : \Throwable
[45] Fix | Delete
{
[46] Fix | Delete
if ($reason instanceof \Throwable) {
[47] Fix | Delete
return $reason;
[48] Fix | Delete
}
[49] Fix | Delete
return new \YoastSEO_Vendor\GuzzleHttp\Promise\RejectionException($reason);
[50] Fix | Delete
}
[51] Fix | Delete
/**
[52] Fix | Delete
* Returns an iterator for the given value.
[53] Fix | Delete
*
[54] Fix | Delete
* @param mixed $value
[55] Fix | Delete
*/
[56] Fix | Delete
public static function iterFor($value) : \Iterator
[57] Fix | Delete
{
[58] Fix | Delete
if ($value instanceof \Iterator) {
[59] Fix | Delete
return $value;
[60] Fix | Delete
}
[61] Fix | Delete
if (\is_array($value)) {
[62] Fix | Delete
return new \ArrayIterator($value);
[63] Fix | Delete
}
[64] Fix | Delete
return new \ArrayIterator([$value]);
[65] Fix | Delete
}
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function