mirror of
https://github.com/predis/predis.git
synced 2026-09-07 08:58:33 +00:00
Rename base response interface to Predis\Response\ResponseInterface.
This commit is contained in:
+2
-1
@@ -60,7 +60,8 @@ v0.9.0 (201x-xx-xx)
|
||||
|
||||
- All of the interfaces and classes related to translated Redis response types
|
||||
have been moved in the new `Predis\Response` namespace and most of them have
|
||||
been renamed to make their fully-qualified name shorter and less redundant.
|
||||
been renamed to make their fully-qualified name less redundant. Now the base
|
||||
response interface is `Predis\Response\ResponseInterface`.
|
||||
|
||||
- The profile factory code has been extrapolated from the abstract Redis profile
|
||||
class and it's now in `Predis\Profile\Factory`.
|
||||
|
||||
@@ -268,7 +268,7 @@ class Client implements ClientInterface
|
||||
$command = new RawCommand($arguments);
|
||||
$response = $this->connection->executeCommand($command);
|
||||
|
||||
if ($response instanceof Response\ObjectInterface) {
|
||||
if ($response instanceof Response\ResponseInterface) {
|
||||
if ($response instanceof Response\ErrorInterface) {
|
||||
$error = true;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ class Client implements ClientInterface
|
||||
{
|
||||
$response = $this->connection->executeCommand($command);
|
||||
|
||||
if ($response instanceof Response\ObjectInterface) {
|
||||
if ($response instanceof Response\ResponseInterface) {
|
||||
if ($response instanceof Response\ErrorInterface) {
|
||||
$response = $this->onResponseError($command, $response);
|
||||
}
|
||||
@@ -336,7 +336,7 @@ class Client implements ClientInterface
|
||||
|
||||
$response = $this->executeCommand($eval);
|
||||
|
||||
if (!$response instanceof Response\ObjectInterface) {
|
||||
if (!$response instanceof Response\ResponseInterface) {
|
||||
$response = $command->parseResponse($response);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class Atomic extends Pipeline
|
||||
$command = $commands->dequeue();
|
||||
$response = $executed[$i];
|
||||
|
||||
if (!$response instanceof Response\ObjectInterface) {
|
||||
if (!$response instanceof Response\ResponseInterface) {
|
||||
$responses[] = $command->parseResponse($response);
|
||||
} else if ($response instanceof Response\ErrorInterface && $exceptions) {
|
||||
$this->exception($connection, $response);
|
||||
|
||||
@@ -132,7 +132,7 @@ class Pipeline implements BasicClientInterface, ExecutableContextInterface
|
||||
$command = $commands->dequeue();
|
||||
$response = $connection->readResponse($command);
|
||||
|
||||
if (!$response instanceof Response\ObjectInterface) {
|
||||
if (!$response instanceof Response\ResponseInterface) {
|
||||
$responses[] = $command->parseResponse($response);
|
||||
} else if ($response instanceof Response\ErrorInterface && $exceptions) {
|
||||
$this->exception($connection, $response);
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Predis\Response;
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
interface ErrorInterface extends ObjectInterface
|
||||
interface ErrorInterface extends ResponseInterface
|
||||
{
|
||||
/**
|
||||
* Returns the error message
|
||||
|
||||
@@ -27,7 +27,7 @@ use Predis\Response;
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
abstract class MultiBulkIterator implements Iterator, Countable, Response\ObjectInterface
|
||||
abstract class MultiBulkIterator implements Iterator, Countable, Response\ResponseInterface
|
||||
{
|
||||
protected $current;
|
||||
protected $position;
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
namespace Predis\Response;
|
||||
|
||||
/**
|
||||
* Represents a complex reply object from Redis.
|
||||
* Represents a complex response object from Redis.
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
interface ObjectInterface
|
||||
interface ResponseInterface
|
||||
{
|
||||
}
|
||||
@@ -16,7 +16,7 @@ namespace Predis\Response;
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
class Status implements ObjectInterface
|
||||
class Status implements ResponseInterface
|
||||
{
|
||||
private static $OK;
|
||||
private static $QUEUED;
|
||||
|
||||
@@ -71,7 +71,7 @@ class PipelineTest extends PredisTestCase
|
||||
*/
|
||||
public function testDoesNotParseComplexResponseObjects()
|
||||
{
|
||||
$object = $this->getMock('Predis\Response\ObjectInterface');
|
||||
$object = $this->getMock('Predis\Response\ResponseInterface');
|
||||
|
||||
$connection = $this->getMock('Predis\Connection\SingleConnectionInterface');
|
||||
$connection->expects($this->once())
|
||||
|
||||
@@ -28,7 +28,7 @@ class ErrorTest extends PredisTestCase
|
||||
$error = new Error(self::ERR_WRONG_KEY_TYPE);
|
||||
|
||||
$this->assertInstanceOf('Predis\Response\ErrorInterface', $error);
|
||||
$this->assertInstanceOf('Predis\Response\ObjectInterface', $error);
|
||||
$this->assertInstanceOf('Predis\Response\ResponseInterface', $error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,7 @@ class ServerExceptionTest extends PredisTestCase
|
||||
|
||||
$this->assertInstanceOf('Predis\Response\ServerException', $exception);
|
||||
$this->assertInstanceOf('Predis\Response\ErrorInterface', $exception);
|
||||
$this->assertInstanceOf('Predis\Response\ObjectInterface', $exception);
|
||||
$this->assertInstanceOf('Predis\Response\ResponseInterface', $exception);
|
||||
$this->assertInstanceOf('Predis\PredisException', $exception);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class StatusTest extends PredisTestCase
|
||||
{
|
||||
$status = new Status('OK');
|
||||
|
||||
$this->assertInstanceOf('Predis\Response\ObjectInterface', $status);
|
||||
$this->assertInstanceOf('Predis\Response\ResponseInterface', $status);
|
||||
$this->assertSame('OK', $status->getPayload());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user