\Zend\Diactoros\RequestArraySerializer

Serialize or deserialize request messages to/from arrays.

This class provides functionality for serializing a RequestInterface instance to an array, as well as the reverse operation of creating a Request instance from an array representing a message.

Summary

Methods
Properties
Constants
toArray()
fromArray()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getValueFromKey()
No private properties found
N/A

Methods

toArray()

toArray(\Psr\Http\Message\RequestInterface  $request) : array

Serialize a request message to an array.

Parameters

\Psr\Http\Message\RequestInterface $request

Returns

array

fromArray()

fromArray(array  $serializedRequest) : \Zend\Diactoros\Request

Deserialize a request array to a request instance.

Parameters

array $serializedRequest

Throws

\UnexpectedValueException

when cannot deserialize response

Returns

\Zend\Diactoros\Request

getValueFromKey()

getValueFromKey(array  $data, string  $key, string  $message = null) : mixed

Parameters

array $data
string $key
string $message

Throws

\UnexpectedValueException

Returns

mixed