Przeglądaj źródła

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

Daniele Alessandri 15 lat temu
rodzic
commit
e8a0f3f627
1 zmienionych plików z 2 dodań i 1 usunięć
  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--;
         }