Browse Source

Minor tweaks to code.

Also removed a useless method, most likely a leftover from the past.
Daniele Alessandri 11 years ago
parent
commit
a4d0abc734

+ 0 - 8
lib/Predis/Protocol/Text/ComposableProtocolProcessor.php

@@ -41,14 +41,6 @@ class ComposableProtocolProcessor implements ProtocolProcessorInterface
         $this->setResponseReader($reader ?: new ResponseReader());
     }
 
-    /**
-     * {@inheritdoc}
-     */
-    public function serialize(CommandInterface $command)
-    {
-        return $this->serializer->serialize($command);
-    }
-
     /**
      * {@inheritdoc}
      */

+ 2 - 1
lib/Predis/Protocol/Text/ProtocolProcessor.php

@@ -45,7 +45,8 @@ class ProtocolProcessor implements ProtocolProcessorInterface
      */
     public function write(ComposableConnectionInterface $connection, CommandInterface $command)
     {
-        $connection->writeBytes($this->serializer->serialize($command));
+        $request = $this->serializer->serialize($command);
+        $connection->writeBytes($request);
     }
 
     /**

+ 3 - 3
lib/Predis/Protocol/Text/RequestSerializer.php

@@ -27,13 +27,13 @@ class RequestSerializer implements RequestSerializerInterface
      */
     public function serialize(CommandInterface $command)
     {
-        $commandId = $command->getId();
+        $commandID = $command->getId();
         $arguments = $command->getArguments();
 
-        $cmdlen = strlen($commandId);
+        $cmdlen = strlen($commandID);
         $reqlen = count($arguments) + 1;
 
-        $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandId}\r\n";
+        $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n";
 
         for ($i = 0; $i < $reqlen - 1; $i++) {
             $argument = $arguments[$i];