Documentation

MessageTrait

Trait implementing functionality common to requests and responses.

Table of Contents

$headerNames  : array<string|int, mixed>
$headers  : array<string|int, mixed>
$protocol  : string
$stream  : StreamInterface|null
getBody()  : mixed
getHeader()  : mixed
getHeaderLine()  : mixed
getHeaders()  : mixed
getProtocolVersion()  : mixed
hasHeader()  : mixed
withAddedHeader()  : mixed
withBody()  : mixed
withHeader()  : mixed
withoutHeader()  : mixed
withProtocolVersion()  : mixed
assertHeader()  : mixed
normalizeHeaderValue()  : mixed
setHeaders()  : mixed
trimHeaderValues()  : array<string|int, string>
Trims whitespace from the header values.

Properties

$headerNames

private array<string|int, mixed> $headerNames = []

Methods

getBody()

public getBody() : mixed
Return values
mixed

getHeader()

public getHeader(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

getHeaderLine()

public getHeaderLine(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

getHeaders()

public getHeaders() : mixed
Return values
mixed

getProtocolVersion()

public getProtocolVersion() : mixed
Return values
mixed

hasHeader()

public hasHeader(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

withAddedHeader()

public withAddedHeader(mixed $header, mixed $value) : mixed
Parameters
$header : mixed
$value : mixed
Return values
mixed

withHeader()

public withHeader(mixed $header, mixed $value) : mixed
Parameters
$header : mixed
$value : mixed
Return values
mixed

withoutHeader()

public withoutHeader(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

withProtocolVersion()

public withProtocolVersion(mixed $version) : mixed
Parameters
$version : mixed
Return values
mixed

assertHeader()

private assertHeader(mixed $header) : mixed
Parameters
$header : mixed
Return values
mixed

normalizeHeaderValue()

private normalizeHeaderValue(mixed $value) : mixed
Parameters
$value : mixed
Return values
mixed

setHeaders()

private setHeaders(array<string|int, mixed> $headers) : mixed
Parameters
$headers : array<string|int, mixed>
Return values
mixed

trimHeaderValues()

Trims whitespace from the header values.

private trimHeaderValues(array<string|int, string> $values) : array<string|int, string>

Spaces and tabs ought to be excluded by parsers when extracting the field value from a header field.

header-field = field-name ":" OWS field-value OWS OWS = *( SP / HTAB )

Parameters
$values : array<string|int, string>

Header values

Tags
see
https://tools.ietf.org/html/rfc7230#section-3.2.4
Return values
array<string|int, string>

Trimmed header values

Search results