Handler extends Handler
Table of Contents
Constants
- BODY_RECEIVED = 5
- BODY_SENT = 3
- CONNECT_RECEIVED = 7
- CONNECT_SENT = 6
- CONNECTED = 1
- HEADERS_RECEIVED = 4
- HEADERS_SENT = 2
- PENDING = 0
Methods
- __construct() : mixed
- getDebugLevel() : int
- Returns the current level.
- getLogger() : LoggerInterface|null
- Returns the logger from the configuration settings.
- getRequest() : RequestInterface
- getResponse() : Response|null
- getSocket() : Stream
- Returns the associated socket.
- getState() : int
- log() : void
- process() : void
- Processes the given promise. The promise can be left in the pending state, fulfilled or rejected.
- setDebugLevel() : mixed
- Sets debug level using HttpDebug::* constants.
- shouldFetchBody() : void
- Sets a callback called before fetching a message body.
Constants
BODY_RECEIVED
public
mixed
BODY_RECEIVED
= 5
BODY_SENT
public
mixed
BODY_SENT
= 3
CONNECT_RECEIVED
public
mixed
CONNECT_RECEIVED
= 7
CONNECT_SENT
public
mixed
CONNECT_SENT
= 6
CONNECTED
public
mixed
CONNECTED
= 1
HEADERS_RECEIVED
public
mixed
HEADERS_RECEIVED
= 4
HEADERS_SENT
public
mixed
HEADERS_SENT
= 2
PENDING
public
mixed
PENDING
= 0
Methods
__construct()
public
__construct(RequestInterface $request, ResponseBuilderInterface $responseBuilder[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $request : RequestInterface
- $responseBuilder : ResponseBuilderInterface
- $options : array<string|int, mixed> = []
getDebugLevel()
Returns the current level.
public
getDebugLevel() : int
Return values
int —HttpDebug::* constants
getLogger()
Returns the logger from the configuration settings.
public
getLogger() : LoggerInterface|null
Return values
LoggerInterface|nullgetRequest()
public
getRequest() : RequestInterface
Return values
RequestInterfacegetResponse()
public
getResponse() : Response|null
Return values
Response|nullgetSocket()
Returns the associated socket.
public
getSocket() : Stream
Return values
StreamgetState()
public
getState() : int
Return values
intlog()
public
log(string $logMessage, int $level) : void
Parameters
- $logMessage : string
- $level : int
process()
Processes the given promise. The promise can be left in the pending state, fulfilled or rejected.
public
process(Promise $promise) : void
Parameters
- $promise : Promise
setDebugLevel()
Sets debug level using HttpDebug::* constants.
public
setDebugLevel(int $debugLevel) : mixed
Parameters
- $debugLevel : int
shouldFetchBody()
Sets a callback called before fetching a message body.
public
shouldFetchBody(callable $callback) : void
Parameters
- $callback : callable