LogDataTrait

Helper for handling both serialize()/unserialize() and json_encode()/json_decode() when migrating to json-encoded strings.

Table of Contents

Methods

formatLogDetails()  : string
Replaces a string with placeholders (%s or {myPlaceholder}) with its substitutes.
formatLogDetailsStatic()  : string
Static version for ViewHelpers etc.
unserializeLogData()  : array<string|int, mixed>|null
Useful for handling old serialized data, which might have been migrated to JSON encoded properties already.

Methods

formatLogDetails()

Replaces a string with placeholders (%s or {myPlaceholder}) with its substitutes.

protected formatLogDetails(string $detailString, mixed $substitutes) : string
Parameters
$detailString : string
$substitutes : mixed
Return values
string

formatLogDetailsStatic()

Static version for ViewHelpers etc.

protected static formatLogDetailsStatic(string $detailString, array<string|int, mixed> $substitutes) : string

Replaces a string with placeholders (%s or {myPlaceholder}) with its substitutes.

Parameters
$detailString : string
$substitutes : array<string|int, mixed>
Return values
string

unserializeLogData()

Useful for handling old serialized data, which might have been migrated to JSON encoded properties already.

protected unserializeLogData(mixed $logData) : array<string|int, mixed>|null
Parameters
$logData : mixed
Return values
array<string|int, mixed>|null

        
On this page

Search results