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