SDK for PHP 3.x

Message
in package
implements ArrayAccess, IteratorAggregate

Represents an SNS message received over http(s).

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate

Methods

__construct()  : mixed
Creates a Message object from an array of raw message data.
fromJsonString()  : Message
Creates a Message object from a JSON-decodable string.
fromPsrRequest()  : Message
Creates a Message object from a PSR-7 Request or ServerRequest object.
fromRawPostData()  : Message
Creates a Message object from the raw POST data
getIterator()  : mixed
offsetExists()  : mixed
offsetGet()  : mixed
offsetSet()  : mixed
offsetUnset()  : mixed
toArray()  : array<string|int, mixed>
Get all the message data as a plain array.

Methods

__construct()

Creates a Message object from an array of raw message data.

public __construct(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>

The message data.

Tags
throws
InvalidArgumentException

If a valid type is not provided or there are other required keys missing.

fromJsonString()

Creates a Message object from a JSON-decodable string.

public static fromJsonString(string $requestBody) : Message
Parameters
$requestBody : string
Return values
Message

fromRawPostData()

Creates a Message object from the raw POST data

public static fromRawPostData() : Message
Tags
throws
RuntimeException

If the POST data is absent, or not a valid JSON document

Return values
Message

getIterator()

public getIterator() : mixed

offsetExists()

public offsetExists(mixed $key) : mixed
Parameters
$key : mixed

offsetGet()

public offsetGet(mixed $key) : mixed
Parameters
$key : mixed

offsetSet()

public offsetSet(mixed $key, mixed $value) : mixed
Parameters
$key : mixed
$value : mixed

offsetUnset()

public offsetUnset(mixed $key) : mixed
Parameters
$key : mixed

toArray()

Get all the message data as a plain array.

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>
On this page