Documentation

ChunkInterface

The interface of chunks returned by ResponseStreamInterface::current().

When the chunk is first, last or timeout, the content MUST be empty. When an unchecked timeout or a network error occurs, a TransportExceptionInterface MUST be thrown by the destructor unless one was already thrown by another method.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

getContent()  : string
Returns the content of the response chunk.
getError()  : string|null
In case of error, returns the message that describes it.
getInformationalStatus()  : array<string|int, mixed>|null
Returns a [status code, headers] tuple when a 1xx status code was just received.
getOffset()  : int
Returns the offset of the chunk in the response body.
isFirst()  : bool
Tells when headers just arrived.
isLast()  : bool
Tells when the body just completed.
isTimeout()  : bool
Tells when the idle timeout has been reached.

Methods

getContent()

Returns the content of the response chunk.

public getContent() : string
Tags
throws
TransportExceptionInterface

on a network error or when the idle timeout is reached

Return values
string

getError()

In case of error, returns the message that describes it.

public getError() : string|null
Return values
string|null

getInformationalStatus()

Returns a [status code, headers] tuple when a 1xx status code was just received.

public getInformationalStatus() : array<string|int, mixed>|null
Tags
throws
TransportExceptionInterface

on a network error or when the idle timeout is reached

Return values
array<string|int, mixed>|null

getOffset()

Returns the offset of the chunk in the response body.

public getOffset() : int
Return values
int

Search results