Explorar o código

Use a nicer looking version for the same code.

Daniele Alessandri %!s(int64=12) %!d(string=hai) anos
pai
achega
b50a5975ac

+ 5 - 3
lib/Predis/Cluster/PredisClusterHashStrategy.php

@@ -294,9 +294,11 @@ class PredisClusterHashStrategy implements CommandHashStrategyInterface
      */
     protected function getKeyFromScriptingCommands(CommandInterface $command)
     {
-        $keys = $command instanceof ScriptedCommand
-                    ? $command->getKeys()
-                    : array_slice($args = $command->getArguments(), 2, $args[1]);
+        if ($command instanceof ScriptedCommand) {
+            $keys = $command->getKeys();
+        } else {
+            $keys = array_slice($args = $command->getArguments(), 2, $args[1]);
+        }
 
         if ($keys && $this->checkSameHashForKeys($keys)) {
             return $keys[0];

+ 5 - 3
lib/Predis/Cluster/RedisClusterHashStrategy.php

@@ -246,9 +246,11 @@ class RedisClusterHashStrategy implements CommandHashStrategyInterface
      */
     protected function getKeyFromScriptingCommands(CommandInterface $command)
     {
-        $keys = $command instanceof ScriptedCommand
-                    ? $command->getKeys()
-                    : array_slice($args = $command->getArguments(), 2, $args[1]);
+        if ($command instanceof ScriptedCommand) {
+            $keys = $command->getKeys();
+        } else {
+            $keys = array_slice($args = $command->getArguments(), 2, $args[1]);
+        }
 
         if (count($keys) === 1) {
             return $keys[0];