ソースを参照

Remove implementation of Predis\Command\RawCommand::__toString().

See #151 and message of commit 5c5dd40, forgot to apply the same
change to the Predis\Command\RawCommand class.
Daniele Alessandri 11 年 前
コミット
a2265b12b3
2 ファイル変更0 行追加45 行削除
  1. 0 32
      lib/Predis/Command/RawCommand.php
  2. 0 13
      tests/Predis/Command/RawCommandTest.php

+ 0 - 32
lib/Predis/Command/RawCommand.php

@@ -124,36 +124,4 @@ class RawCommand implements CommandInterface
     {
         return $data;
     }
-
-    /**
-     * Helper function used to reduce a list of arguments to a string.
-     *
-     * @param  string $accumulator Temporary string.
-     * @param  string $argument    Current argument.
-     * @return string
-     */
-    protected function toStringArgumentReducer($accumulator, $argument)
-    {
-        if (strlen($argument) > 32) {
-            $argument = substr($argument, 0, 32) . '[...]';
-        }
-
-        $accumulator .= " $argument";
-
-        return $accumulator;
-    }
-
-    /**
-     * Returns a partial string representation of the command with its arguments.
-     *
-     * @return string
-     */
-    public function __toString()
-    {
-        return array_reduce(
-            $this->getArguments(),
-            array($this, 'toStringArgumentReducer'),
-            $this->getId()
-        );
-    }
 }

+ 0 - 13
tests/Predis/Command/RawCommandTest.php

@@ -138,17 +138,4 @@ class RawCommandTest extends PredisTestCase
 
         $this->assertSame('SET', $command->getId());
     }
-
-    /**
-     * @group disconnected
-     */
-    public function testToString()
-    {
-        $arguments = array('SET', 'key', 'value');
-        $expected = implode(' ', $arguments);
-
-        $command = new RawCommand($arguments);
-
-        $this->assertEquals($expected, (string) $command);
-    }
 }