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

Details

at line 59
__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 80
static createFromString(string $json)

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

Parameters

string $json

at line 103
getLogLevel()

at line 110
getApi()

at line 115
getRequest()

at line 123
Exception|null getException()

Return Value

Exception|null

at line 131
getDuration()

The duration in microseconds.

at line 139
ResponseInterface|null getResponse()

Return Value

ResponseInterface|null

at line 147
isError()

True if the requests threw an error.

at line 166
jsonSerialize()

{@inheritdoc}

at line 174
serialize()

{@inheritdoc}

at line 182
unserialize($serialized)

{@inheritdoc}

Parameters

$serialized

at line 196
asString()

Returns a string representation of the current message.

at line 201
__toString()