Move method to the base Predis\Network\ConnectionBase class.

This commit is contained in:
Daniele Alessandri
2011-04-04 10:37:53 +02:00
parent 8300b1d63c
commit 503cc86f7d
3 changed files with 8 additions and 10 deletions
+8
View File
@@ -71,6 +71,14 @@ abstract class ConnectionBase implements IConnectionSingle {
return $this->readResponse($command);
}
public function readResponse(ICommand $command) {
$reply = $this->read();
if (isset($reply->skipParse)) {
return $reply;
}
return $command->parseResponse($reply);
}
protected function onCommunicationException($message, $code = null) {
Utils::onCommunicationException(
new CommunicationException($this, $message, $code)
@@ -253,9 +253,4 @@ class PhpiredisConnection extends ConnectionBase {
array_unshift($cmdargs, $command->getId());
$this->write(phpiredis_format_command($cmdargs));
}
public function readResponse(ICommand $command) {
$reply = $this->read();
return isset($reply->skipParse) ? $reply : $command->parseResponse($reply);
}
}
-5
View File
@@ -194,9 +194,4 @@ class StreamConnection extends ConnectionBase {
}
$this->write($buffer);
}
public function readResponse(ICommand $command) {
$reply = $this->read();
return isset($reply->skipParse) ? $reply : $command->parseResponse($reply);
}
}