Documentation

Promise extends AbstractPromise
in package

HTTP promise class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

Table of Contents

Constants

CANCELLED  = 'CANCELLED'
FULFILLED  = 'FULFILLED'
PENDING  = 'PENDING'
Status constants
REJECTED  = 'REJECTED'

Properties

$cancel  : CallableObject|null
Cancel callable
$failure  : CallableObject|null
Failure callable
$finally  : CallableObject|null
Cancel callable
$promiser  : Client|CurlMulti|null
Client Promiser
$state  : string
Current state
$success  : array<string|int, mixed>
Success callables

Methods

__construct()  : mixed
Constructor
cancel()  : void
Cancel method
catch()  : AbstractPromise
Method to set failure callable (alias)
create()  : static
Factory to create a Promise object
finally()  : AbstractPromise
Method to set finally callable (alias)
forward()  : AbstractPromise
Forward method
getCancel()  : CallableObject|null
Method to get cancel callable
getFailure()  : CallableObject|null
Method to get failure callable
getFinally()  : CallableObject|null
Method to get finally callable
getPromiser()  : Client|CurlMulti
Method to get client promiser
getState()  : string
Method to get current state
getSuccess()  : array<string|int, mixed>|CallableObject|null
Method to get success callable
hasCancel()  : bool
Method to check cancel callable
hasFailure()  : bool
Method to check failure callable
hasFinally()  : bool
Method to check finally callable
hasPromiser()  : bool
Method to check client promiser
hasState()  : bool
Method to check current state
hasSuccess()  : bool
Method to check success callable
isCancelled()  : bool
Determine is the promise is cancelled
isFulfilled()  : bool
Determine is the promise is fulfilled
isPending()  : bool
Determine is the promise is pending
isRejected()  : bool
Determine is the promise is rejected
resolve()  : void
Resolve method
setCancel()  : AbstractPromise
Method to set cancel callable
setFailure()  : AbstractPromise
Method to set failure callable
setFinally()  : PromiseInterface
Method to set finally callable
setPromiser()  : PromiseInterface
Method to set client promiser
setState()  : AbstractPromise
Method to set current state
setSuccess()  : AbstractPromise
Method to set success callable
then()  : AbstractPromise
Then method
wait()  : Response|string|array<string|int, mixed>|null
Wait method

Constants

Properties

$success

Success callables

protected array<string|int, mixed> $success = []

Methods

getState()

Method to get current state

public getState() : string
Return values
string

getSuccess()

Method to get success callable

public getSuccess([int|null $i = null ]) : array<string|int, mixed>|CallableObject|null
Parameters
$i : int|null = null
Return values
array<string|int, mixed>|CallableObject|null

hasCancel()

Method to check cancel callable

public hasCancel() : bool
Return values
bool

hasFailure()

Method to check failure callable

public hasFailure() : bool
Return values
bool

hasFinally()

Method to check finally callable

public hasFinally() : bool
Return values
bool

hasPromiser()

Method to check client promiser

public hasPromiser() : bool
Return values
bool

hasState()

Method to check current state

public hasState() : bool
Return values
bool

hasSuccess()

Method to check success callable

public hasSuccess([int|null $i = null ]) : bool
Parameters
$i : int|null = null
Return values
bool

isCancelled()

Determine is the promise is cancelled

public isCancelled() : bool
Return values
bool

isFulfilled()

Determine is the promise is fulfilled

public isFulfilled() : bool
Return values
bool

isPending()

Determine is the promise is pending

public isPending() : bool
Return values
bool

isRejected()

Determine is the promise is rejected

public isRejected() : bool
Return values
bool

        
On this page

Search results