All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
41 lines
941 B
PHP
41 lines
941 B
PHP
<?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;
|
|
}
|
|
}
|