Message
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|null $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)
Constructor.
static Message
createFromString(string $json)
Creates a new instance of the class from a JSON string.
string
getLogLevel()
No description
string
getApi()
No description
RequestInterface
getRequest()
No description
Exception|null
getException()
No description
float|null
getDuration()
No description
ResponseInterface|null
getResponse()
No description
bool
isError()
True if the requests threw an error.
jsonSerialize()
{@inheritdoc}
serialize()
{@inheritdoc}
unserialize($serialized)
{@inheritdoc}
string
asString()
Returns a string representation of the current message.
string
__toString()
No description
Details
at line 57
__construct(string $api, float|null $duration, RequestInterface $request, ResponseInterface $response = null, Exception $exception = null)
Constructor.
at line 85
static Message
createFromString(string $json)
Creates a new instance of the class from a JSON string.
at line 113
string
getLogLevel()
at line 123
string
getApi()
at line 131
RequestInterface
getRequest()
at line 139
Exception|null
getException()
at line 147
float|null
getDuration()
at line 155
ResponseInterface|null
getResponse()
at line 165
bool
isError()
True if the requests threw an error.
at line 187
jsonSerialize()
{@inheritdoc}
at line 195
serialize()
{@inheritdoc}
at line 203
unserialize($serialized)
{@inheritdoc}
at line 219
string
asString()
Returns a string representation of the current message.