Skip to content

Commit 34510c1

Browse files
committed
Rename handleReply() to handleMessage()
1 parent 0bbc690 commit 34510c1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Client.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use RuntimeException;
1414
use React\Promise\Deferred;
1515
use Clue\Redis\Protocol\Model\ErrorReply;
16+
use Clue\Redis\Protocol\Model\ModelInterface;
1617

1718
class Client extends EventEmitter
1819
{
@@ -47,7 +48,7 @@ public function __construct(Stream $stream, ParserInterface $parser = null, Seri
4748

4849
foreach ($models as $data) {
4950
try {
50-
$that->handleReply($data);
51+
$that->handleMessage($data);
5152
}
5253
catch (UnderflowException $error) {
5354
$that->emit('error', array($error));
@@ -86,9 +87,9 @@ public function __call($name, $args)
8687
return $request->promise();
8788
}
8889

89-
public function handleReply($data)
90+
public function handleMessage(ModelInterface $message)
9091
{
91-
$this->emit('message', array($data, $this));
92+
$this->emit('message', array($message, $this));
9293

9394
if (!$this->requests) {
9495
throw new UnderflowException('Unexpected reply received, no matching request found');
@@ -97,10 +98,10 @@ public function handleReply($data)
9798
$request = array_shift($this->requests);
9899
/* @var $request Deferred */
99100

100-
if ($data instanceof ErrorReply) {
101-
$request->reject($data);
101+
if ($message instanceof ErrorReply) {
102+
$request->reject($message);
102103
} else {
103-
$request->resolve($data->getValueNative());
104+
$request->resolve($message->getValueNative());
104105
}
105106

106107
if ($this->ending && !$this->isBusy()) {

0 commit comments

Comments
 (0)