Skip to content

Commit

Permalink
Encode array for logging (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored Apr 14, 2020
1 parent 85b62da commit 357317d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Watchers/RedisWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ private function formatCommand($command, $parameters)
$parameters = collect($parameters)->map(function ($parameter) {
if (is_array($parameter)) {
return collect($parameter)->map(function ($value, $key) {
if (is_array($value)) {
return json_encode($value);
}

return is_int($key) ? $value : "{$key} {$value}";
})->implode(' ');
}
Expand Down

0 comments on commit 357317d

Please sign in to comment.