AbstractSerializer
in package
AbstractYes
Provides base functionality for request and response de/serialization strategies, including functionality for retrieving a line at a time from the message, splitting headers from the body, and serializing headers.
Table of Contents
Constants
Methods
- filterHeader() : string
- Filter a header name to wordcase
- getLine() : string
- Retrieve a single line from the stream.
- serializeHeaders() : string
- Serialize headers to string values.
- splitStream() : array<string|int, mixed>
- Split the stream into headers and body content.
Constants
CR
public
mixed
CR
= "\r"
EOL
public
mixed
EOL
= "\r\n"
LF
public
mixed
LF
= "\n"
Methods
filterHeader()
Filter a header name to wordcase
protected
static filterHeader(string $header) : string
Parameters
- $header : string
Return values
stringgetLine()
Retrieve a single line from the stream.
protected
static getLine(StreamInterface $stream) : string
Retrieves a line from the stream; a line is defined as a sequence of characters ending in a CRLF sequence.
Parameters
- $stream : StreamInterface
Tags
Return values
stringserializeHeaders()
Serialize headers to string values.
protected
static serializeHeaders(array<string|int, mixed> $headers) : string
Parameters
- $headers : array<string|int, mixed>
Tags
Return values
stringsplitStream()
Split the stream into headers and body content.
protected
static splitStream(StreamInterface $stream) : array<string|int, mixed>
Returns an array containing two elements
- The first is an array of headers
- The second is a StreamInterface containing the body content
Parameters
- $stream : StreamInterface