Browse Source

Rename Predis\Client::raw() to Predis\Client::executeRaw().

This is more consistent with Predis\Client::executeRaw() and its more
explicit since simply "raw" as a method name was a bit too vague even
despite being nicely short.
Daniele Alessandri 11 years ago
parent
commit
cbf015164c
5 changed files with 12 additions and 10 deletions
  1. 1 1
      CHANGELOG.md
  2. 1 1
      README.md
  3. 3 1
      examples/SendingRedisCommands.php
  4. 1 1
      lib/Predis/Client.php
  5. 6 6
      tests/Predis/ClientTest.php

+ 1 - 1
CHANGELOG.md

@@ -79,7 +79,7 @@ v0.9.0 (201x-xx-xx)
   they can also define the needed logic in their command classes by implementing
   `Predis\Command\PrefixableCommandInterface` just like before.
 
-- The client can now send raw commands using the `Predis\Client::raw()` method.
+- The client can now send raw commands using `Predis\Client::executeRaw()`.
 
 
 v0.8.5 (2013-xx-xx)

+ 1 - 1
README.md

@@ -238,7 +238,7 @@ responses. Users must provide the arguments list as an array, following the comm
 defined by the [Redis documentation for commands](http://redis.io/commands):
 
 ```php
-$response = $client->raw(['SET', 'foo', 'bar']);
+$response = $client->executeRaw(['SET', 'foo', 'bar']);
 ```
 
 

+ 3 - 1
examples/SendingRedisCommands.php

@@ -44,7 +44,9 @@ array (
 // commands to Redis the usual way and the "raw" way is that in the latter case
 // their arguments are not filtered nor responses coming from Redis are parsed.
 
-$response = $client->raw(array('MGET', 'uid:0001', 'uid:0002', 'uid:0003'));
+$response = $client->executeRaw(array(
+    'MGET', 'uid:0001', 'uid:0002', 'uid:0003'
+));
 
 var_export($response); echo PHP_EOL;
 /* OUTPUT:

+ 1 - 1
lib/Predis/Client.php

@@ -263,7 +263,7 @@ class Client implements ClientInterface
      * @param bool $error Set to TRUE when Redis returned an error response.
      * @return mixed
      */
-    public function raw(array $arguments, &$error = null)
+    public function executeRaw(array $arguments, &$error = null)
     {
         $error = false;
 

+ 6 - 6
tests/Predis/ClientTest.php

@@ -518,11 +518,11 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($connection);
 
-        $this->assertSame('OK', $client->raw(array('SET', 'foo', 'bar')));
-        $this->assertSame('bar', $client->raw(array('GET', 'foo')));
+        $this->assertSame('OK', $client->executeRaw(array('SET', 'foo', 'bar')));
+        $this->assertSame('bar', $client->executeRaw(array('GET', 'foo')));
 
         $error = true;  // $error is always populated by reference.
-        $this->assertSame('PONG', $client->raw(array('PING'), $error));
+        $this->assertSame('PONG', $client->executeRaw(array('PING'), $error));
         $this->assertFalse($error);
     }
 
@@ -543,8 +543,8 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($connection, array('prefix' => 'predis:'));
 
-        $this->assertSame('OK', $client->raw(array('SET', 'foo', 'bar')));
-        $this->assertSame('bar', $client->raw(array('GET', 'foo')));
+        $this->assertSame('OK', $client->executeRaw(array('SET', 'foo', 'bar')));
+        $this->assertSame('bar', $client->executeRaw(array('GET', 'foo')));
     }
 
     /**
@@ -563,7 +563,7 @@ class ClientTest extends PredisTestCase
 
         $client = new Client($connection, array('exceptions' => true));
 
-        $this->assertSame($message, $client->raw(array('PING'), $error));
+        $this->assertSame($message, $client->executeRaw(array('PING'), $error));
         $this->assertTrue($error);
     }