class Message implements Serializable, JsonSerializable

Message class.

This class is a representation of a log message which contains API-related information and can easily be serialized.

Methods

__construct(string $api, float $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)

Constructor.

static 
createFromString(string $json)

Creates a new instance of the class from a JSON string.

getLogLevel()

No description

getApi()

No description

getRequest()

No description

Exception|null
getException()

No description

getDuration()

The duration in microseconds.

ResponseInterface|null
getResponse()

No description

isError()

True if the requests threw an error.

jsonSerialize()

{@inheritdoc}

serialize()

{@inheritdoc}

unserialize($serialized)

{@inheritdoc}

asString()

Returns a string representation of the current message.

__toString()

No description

__serialize()

No description

__unserialize(array $data)

No description

Details

at line 55
__construct(string $api, float $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)

Constructor.

Parameters

string $api
float $duration
RequestInterface $request
ResponseInterface $response
Exception $exception

at line 76
static createFromString(string $json)

Creates a new instance of the class from a JSON string.

Parameters

string $json

at line 99
getLogLevel()

at line 106
getApi()

at line 111
getRequest()

at line 119
Exception|null getException()

Return Value

Exception|null

at line 127
getDuration()

The duration in microseconds.

at line 135
ResponseInterface|null getResponse()

Return Value

ResponseInterface|null

at line 143
isError()

True if the requests threw an error.

at line 162
jsonSerialize()

{@inheritdoc}

at line 170
serialize()

{@inheritdoc}

at line 178
unserialize($serialized)

{@inheritdoc}

Parameters

$serialized

at line 192
asString()

Returns a string representation of the current message.

at line 197
__toString()

at line 202
__serialize()

at line 213
__unserialize(array $data)

Parameters

array $data