mirror of
https://github.com/predis/predis.git
synced 2026-09-12 19:37:05 +00:00
Move method to the base Predis\Network\ConnectionBase class.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user