Explorar el Código

Fix for a warning emitted by PHP when passing an array of strings parameters to Predis\Client::create.

Daniele Alessandri hace 15 años
padre
commit
e8a0f3f627
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      lib/Predis.php

+ 2 - 1
lib/Predis.php

@@ -32,7 +32,8 @@ class Client {
         $argc = func_num_args();
 
         $serverProfile = null;
-        if ($argc > 0 && is_subclass_of($argv[$argc-1], '\Predis\RedisServerProfile')) {
+        $lastArg = $argv[$argc-1];
+        if ($argc > 0 && !is_string($lastArg) && is_subclass_of($lastArg, '\Predis\RedisServerProfile')) {
             $serverProfile = array_pop($argv);
             $argc--;
         }