فهرست منبع

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);
-    }
 }