Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
40
vendor/guzzlehttp/promises/src/Is.php
vendored
Normal file
40
vendor/guzzlehttp/promises/src/Is.php
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace GuzzleHttp\Promise;
|
||||
|
||||
final class Is
|
||||
{
|
||||
/**
|
||||
* Returns true if a promise is pending.
|
||||
*/
|
||||
public static function pending(PromiseInterface $promise): bool
|
||||
{
|
||||
return $promise->getState() === PromiseInterface::PENDING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a promise is fulfilled or rejected.
|
||||
*/
|
||||
public static function settled(PromiseInterface $promise): bool
|
||||
{
|
||||
return $promise->getState() !== PromiseInterface::PENDING;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a promise is fulfilled.
|
||||
*/
|
||||
public static function fulfilled(PromiseInterface $promise): bool
|
||||
{
|
||||
return $promise->getState() === PromiseInterface::FULFILLED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a promise is rejected.
|
||||
*/
|
||||
public static function rejected(PromiseInterface $promise): bool
|
||||
{
|
||||
return $promise->getState() === PromiseInterface::REJECTED;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue