| 1 |
<?php |
| 2 |
|
| 3 |
namespace YoastSEO_Vendor\GuzzleHttp\Promise; |
| 4 |
|
| 5 |
final class Is |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Returns true if a promise is pending. |
| 9 |
* |
| 10 |
* @return bool |
| 11 |
*/ |
| 12 |
public static function pending(\YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface $promise) |
| 13 |
{ |
| 14 |
return $promise->getState() === \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface::PENDING; |
| 15 |
} |
| 16 |
/** |
| 17 |
* Returns true if a promise is fulfilled or rejected. |
| 18 |
* |
| 19 |
* @return bool |
| 20 |
*/ |
| 21 |
public static function settled(\YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface $promise) |
| 22 |
{ |
| 23 |
return $promise->getState() !== \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface::PENDING; |
| 24 |
} |
| 25 |
/** |
| 26 |
* Returns true if a promise is fulfilled. |
| 27 |
* |
| 28 |
* @return bool |
| 29 |
*/ |
| 30 |
public static function fulfilled(\YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface $promise) |
| 31 |
{ |
| 32 |
return $promise->getState() === \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface::FULFILLED; |
| 33 |
} |
| 34 |
/** |
| 35 |
* Returns true if a promise is rejected. |
| 36 |
* |
| 37 |
* @return bool |
| 38 |
*/ |
| 39 |
public static function rejected(\YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface $promise) |
| 40 |
{ |
| 41 |
return $promise->getState() === \YoastSEO_Vendor\GuzzleHttp\Promise\PromiseInterface::REJECTED; |
| 42 |
} |
| 43 |
} |
| 44 |
|