Message
in package
implements
MessageInterface
Implements a HTTP message
Tags
Table of Contents
Interfaces
- MessageInterface
Properties
- $body : StreamInterface
- $headers : array<string, array{name: string, value: string[]}>
- $version : string
Methods
- __construct() : mixed
- Message constructor.
- getBody() : StreamInterface
- getHeader() : array<string|int, mixed>
- getHeaderLine() : string
- getHeaders() : array<string|int, mixed>
- getProtocolVersion() : string
- hasHeader() : bool
- withAddedHeader() : static
- withBody() : static
- withHeader() : static
- withoutHeader() : static
- withProtocolVersion() : static
- checkName() : string
- checks/cleans a header name
- checkValue() : array<string|int, string>
Properties
$body
protected
StreamInterface
$body
$headers
protected
array<string, array{name: string, value: string[]}>
$headers
= []
$version
protected
string
$version
= '1.1'
Methods
__construct()
Message constructor.
public
__construct([StreamInterface|string|null $body = null ]) : mixed
Parameters
- $body : StreamInterface|string|null = null
getBody()
public
getBody() : StreamInterface
Return values
StreamInterfacegetHeader()
public
getHeader(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed>getHeaderLine()
public
getHeaderLine(string $name) : string
Parameters
- $name : string
Return values
stringgetHeaders()
public
getHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getProtocolVersion()
public
getProtocolVersion() : string
Return values
stringhasHeader()
public
hasHeader(string $name) : bool
Parameters
- $name : string
Return values
boolwithAddedHeader()
public
withAddedHeader(string $name, mixed $value) : static
Parameters
- $name : string
- $value : mixed
Return values
staticwithBody()
public
withBody(StreamInterface $body) : static
Parameters
- $body : StreamInterface
Return values
staticwithHeader()
public
withHeader(string $name, mixed $value) : static
Parameters
- $name : string
- $value : mixed
Return values
staticwithoutHeader()
public
withoutHeader(string $name) : static
Parameters
- $name : string
Return values
staticwithProtocolVersion()
public
withProtocolVersion(string $version) : static
Parameters
- $version : string
Return values
staticcheckName()
checks/cleans a header name
protected
checkName(string $name) : string
Parameters
- $name : string
Tags
Return values
stringcheckValue()
protected
checkValue(mixed $value) : array<string|int, string>
Parameters
- $value : mixed