Skip to content

Commit a2ebcd1

Browse files
committed
Update Predis.php
1 parent 47a39fc commit a2ebcd1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/Dashboards/Redis/Compatibility/Predis.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,17 @@ public function xRange(string $stream, string $start, string $end): array {
132132
* @param string $id
133133
* @param array<int, string> $messages
134134
* @param int $maxLen
135-
* @param bool $isApproximate
136135
*
137136
* @return string
138137
*/
139-
public function xAdd(string $key, string $id, array $messages, int $maxLen = 0, bool $isApproximate = false): string {
140-
return $this->executeRaw(['XADD', $key, $id, $messages, $maxLen, $isApproximate]);
138+
public function xAdd(string $key, string $id, array $messages, int $maxLen = 0): string {
139+
$messages_arr = [];
140+
141+
foreach ($messages as $field => $value) {
142+
$messages_arr[] = $field.' '.$value;
143+
}
144+
145+
return $this->executeRaw(['XADD', $key, $id, $maxLen, implode(' ', $messages_arr)]);
141146
}
142147

143148
/**

0 commit comments

Comments
 (0)