Skip to content

Commit 6744f0b

Browse files
committed
Fix interpreting reply messages
1 parent ac1df72 commit 6744f0b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

example/cli.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
use Clue\Redis\Protocol\ErrorReplyException;
4-
3+
use Clue\Redis\Protocol\Model\ErrorReply;
54
use Clue\Redis\React\Client;
65
use Clue\Redis\React\Factory;
6+
use Clue\Redis\Protocol\Model\ModelInterface;
77

88
require __DIR__ . '/../vendor/autoload.php';
99

@@ -18,11 +18,11 @@
1818
$factory->createClient()->then(function (Client $client) use ($loop) {
1919
echo '# connected! Entering interactive mode, hit CTRL-D to quit' . PHP_EOL;
2020

21-
$client->on('message', function ($data) {
22-
if ($data instanceof ErrorReplyException) {
21+
$client->on('message', function (ModelInterface $data) {
22+
if ($data instanceof ErrorReply) {
2323
echo '# error reply: ' . $data->getMessage() . PHP_EOL;
2424
} else {
25-
echo '# reply: ' . json_encode($data) . PHP_EOL;
25+
echo '# reply: ' . json_encode($data->getValueNative()) . PHP_EOL;
2626
}
2727
});
2828

0 commit comments

Comments
 (0)