فهرست منبع

Rename the Predis\Protocols namespace to Predis\Protocol.

Daniele Alessandri 13 سال پیش
والد
کامیت
d59556cae1

+ 2 - 2
lib/Predis/Network/ComposableStreamConnection.php

@@ -5,8 +5,8 @@ namespace Predis\Network;
 use Predis\IConnectionParameters;
 use Predis\CommunicationException;
 use Predis\Commands\ICommand;
-use Predis\Protocols\IProtocolProcessor;
-use Predis\Protocols\Text\TextProtocol;
+use Predis\Protocol\IProtocolProcessor;
+use Predis\Protocol\Text\TextProtocol;
 
 class ComposableStreamConnection extends StreamConnection implements IConnectionComposable {
     private $_protocol;

+ 1 - 1
lib/Predis/Network/IConnectionComposable.php

@@ -2,7 +2,7 @@
 
 namespace Predis\Network;
 
-use Predis\Protocols\IProtocolProcessor;
+use Predis\Protocol\IProtocolProcessor;
 
 interface IConnectionComposable extends IConnectionSingle {
     public function setProtocol(IProtocolProcessor $protocol);

+ 1 - 1
lib/Predis/Protocols/ICommandSerializer.php → lib/Predis/Protocol/ICommandSerializer.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols;
+namespace Predis\Protocol;
 
 use Predis\Commands\ICommand;
 

+ 1 - 1
lib/Predis/Protocols/IComposableProtocolProcessor.php → lib/Predis/Protocol/IComposableProtocolProcessor.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols;
+namespace Predis\Protocol;
 
 interface IComposableProtocolProcessor extends IProtocolProcessor {
     public function setSerializer(ICommandSerializer $serializer);

+ 1 - 1
lib/Predis/Protocols/IProtocolProcessor.php → lib/Predis/Protocol/IProtocolProcessor.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols;
+namespace Predis\Protocol;
 
 use Predis\Commands\ICommand;
 use Predis\Network\IConnectionComposable;

+ 1 - 1
lib/Predis/Protocols/IResponseHandler.php → lib/Predis/Protocol/IResponseHandler.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols;
+namespace Predis\Protocol;
 
 use Predis\Network\IConnectionComposable;
 

+ 1 - 1
lib/Predis/Protocols/IResponseReader.php → lib/Predis/Protocol/IResponseReader.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols;
+namespace Predis\Protocol;
 
 use Predis\Network\IConnectionComposable;
 

+ 4 - 4
lib/Predis/Protocols/Text/ComposableTextProtocol.php → lib/Predis/Protocol/Text/ComposableTextProtocol.php

@@ -1,11 +1,11 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Commands\ICommand;
-use Predis\Protocols\IResponseReader;
-use Predis\Protocols\ICommandSerializer;
-use Predis\Protocols\IComposableProtocolProcessor;
+use Predis\Protocol\IResponseReader;
+use Predis\Protocol\ICommandSerializer;
+use Predis\Protocol\IComposableProtocolProcessor;
 use Predis\Network\IConnectionComposable;
 
 class ComposableTextProtocol implements IComposableProtocolProcessor {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseBulkHandler.php → lib/Predis/Protocol/Text/ResponseBulkHandler.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ProtocolException;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseBulkHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseErrorHandler.php → lib/Predis/Protocol/Text/ResponseErrorHandler.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\ServerException;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseErrorHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseErrorSilentHandler.php → lib/Predis/Protocol/Text/ResponseErrorSilentHandler.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\ResponseError;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseErrorSilentHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseIntegerHandler.php → lib/Predis/Protocol/Text/ResponseIntegerHandler.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ProtocolException;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseIntegerHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseMultiBulkHandler.php → lib/Predis/Protocol/Text/ResponseMultiBulkHandler.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ProtocolException;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseMultiBulkHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/ResponseMultiBulkStreamHandler.php → lib/Predis/Protocol/Text/ResponseMultiBulkStreamHandler.php

@@ -1,10 +1,10 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ProtocolException;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 use Predis\Iterators\MultiBulkResponseSimple;
 

+ 2 - 2
lib/Predis/Protocols/Text/ResponseStatusHandler.php → lib/Predis/Protocol/Text/ResponseStatusHandler.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\ResponseQueued;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class ResponseStatusHandler implements IResponseHandler {

+ 2 - 2
lib/Predis/Protocols/Text/TextCommandSerializer.php → lib/Predis/Protocol/Text/TextCommandSerializer.php

@@ -1,9 +1,9 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Commands\ICommand;
-use Predis\Protocols\ICommandSerializer;
+use Predis\Protocol\ICommandSerializer;
 
 class TextCommandSerializer implements ICommandSerializer {
     public function serialize(ICommand $command) {

+ 2 - 2
lib/Predis/Protocols/Text/TextProtocol.php → lib/Predis/Protocol/Text/TextProtocol.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ResponseError;
@@ -8,7 +8,7 @@ use Predis\ResponseQueued;
 use Predis\ServerException;
 use Predis\ProtocolException;
 use Predis\Commands\ICommand;
-use Predis\Protocols\IProtocolProcessor;
+use Predis\Protocol\IProtocolProcessor;
 use Predis\Network\IConnectionComposable;
 use Predis\Iterators\MultiBulkResponseSimple;
 

+ 3 - 3
lib/Predis/Protocols/Text/TextResponseReader.php → lib/Predis/Protocol/Text/TextResponseReader.php

@@ -1,11 +1,11 @@
 <?php
 
-namespace Predis\Protocols\Text;
+namespace Predis\Protocol\Text;
 
 use Predis\Helpers;
 use Predis\ProtocolException;
-use Predis\Protocols\IResponseReader;
-use Predis\Protocols\IResponseHandler;
+use Predis\Protocol\IResponseReader;
+use Predis\Protocol\IResponseHandler;
 use Predis\Network\IConnectionComposable;
 
 class TextResponseReader implements IResponseReader {

+ 13 - 13
test/ClientFeaturesTest.php

@@ -158,7 +158,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
     function testResponseQueued() {
         $response = new \Predis\ResponseQueued();
         $this->assertInstanceOf('\Predis\IReplyObject', $response);
-        $this->assertEquals(\Predis\Protocols\Text\TextProtocol::QUEUED, (string)$response);
+        $this->assertEquals(\Predis\Protocol\Text\TextProtocol::QUEUED, (string)$response);
     }
 
 
@@ -273,30 +273,30 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
     }
 
 
-    /* Predis\Protocols\TextResponseReader */
+    /* Predis\Protocol\TextResponseReader */
 
     function testResponseReader_OptionIterableMultiBulkReplies() {
-        $protocol = new Predis\Protocols\Text\ComposableTextProtocol();
+        $protocol = new Predis\Protocol\Text\ComposableTextProtocol();
         $reader = $protocol->getReader();
         $connection = new \Predis\Network\ComposableStreamConnection(RC::getConnectionParameters(), $protocol);
 
         $reader->setHandler(
-            \Predis\Protocols\Text\TextProtocol::PREFIX_MULTI_BULK,
-            new \Predis\Protocols\Text\ResponseMultiBulkHandler()
+            \Predis\Protocol\Text\TextProtocol::PREFIX_MULTI_BULK,
+            new \Predis\Protocol\Text\ResponseMultiBulkHandler()
         );
         $connection->writeBytes("KEYS *\r\n");
         $this->assertInternalType('array', $reader->read($connection));
 
         $reader->setHandler(
-            \Predis\Protocols\Text\TextProtocol::PREFIX_MULTI_BULK,
-            new \Predis\Protocols\Text\ResponseMultiBulkStreamHandler()
+            \Predis\Protocol\Text\TextProtocol::PREFIX_MULTI_BULK,
+            new \Predis\Protocol\Text\ResponseMultiBulkStreamHandler()
         );
         $connection->writeBytes("KEYS *\r\n");
         $this->assertInstanceOf('\Iterator', $reader->read($connection));
     }
 
     function testResponseReader_OptionExceptionOnError() {
-        $protocol = new Predis\Protocols\Text\ComposableTextProtocol();
+        $protocol = new Predis\Protocol\Text\ComposableTextProtocol();
         $reader = $protocol->getReader();
         $connection = new \Predis\Network\ComposableStreamConnection(RC::getConnectionParameters(), $protocol);
 
@@ -305,8 +305,8 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $reader->read($connection);
 
         $reader->setHandler(
-            \Predis\Protocols\Text\TextProtocol::PREFIX_ERROR,
-            new \Predis\Protocols\Text\ResponseErrorSilentHandler()
+            \Predis\Protocol\Text\TextProtocol::PREFIX_ERROR,
+            new \Predis\Protocol\Text\ResponseErrorSilentHandler()
         );
         $connection->writeBytes($rawCmdUnexpected);
         $errorReply = $reader->read($connection);
@@ -314,8 +314,8 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
         $this->assertEquals(RC::EXCEPTION_WRONG_TYPE, $errorReply->getMessage());
 
         $reader->setHandler(
-            \Predis\Protocols\Text\TextProtocol::PREFIX_ERROR,
-            new \Predis\Protocols\Text\ResponseErrorHandler()
+            \Predis\Protocol\Text\TextProtocol::PREFIX_ERROR,
+            new \Predis\Protocol\Text\ResponseErrorHandler()
         );
         RC::testForServerException($this, RC::EXCEPTION_WRONG_TYPE, function()
             use ($connection, $rawCmdUnexpected) {
@@ -326,7 +326,7 @@ class ClientFeaturesTestSuite extends PHPUnit_Framework_TestCase {
     }
 
     function testResponseReader_EmptyBulkResponse() {
-        $protocol = new \Predis\Protocols\Text\ComposableTextProtocol();
+        $protocol = new \Predis\Protocol\Text\ComposableTextProtocol();
         $connection = new \Predis\Network\ComposableStreamConnection(RC::getConnectionParameters(), $protocol);
         $client = new \Predis\Client($connection);