Pārlūkot izejas kodu

Remove the static method Predis\Client::create().

Daniele Alessandri 15 gadi atpakaļ
vecāks
revīzija
b40c2fd214
2 mainītis faili ar 1 papildinājumiem un 20 dzēšanām
  1. 0 19
      lib/Predis.php
  2. 1 1
      test/PredisShared.php

+ 0 - 19
lib/Predis.php

@@ -38,25 +38,6 @@ class Client {
         $this->setupConnection($parameters);
     }
 
-    public static function create(/* arguments */) {
-        $argv = func_get_args();
-        $argc = func_num_args();
-
-        $options = null;
-        $lastArg = $argv[$argc-1];
-        if ($argc > 0 && !is_string($lastArg) && ($lastArg instanceof ClientOptions ||
-            is_subclass_of($lastArg, '\Predis\RedisServerProfile'))) {
-            $options = array_pop($argv);
-            $argc--;
-        }
-
-        if ($argc === 0) {
-            throw new ClientException('Missing connection parameters');
-        }
-
-        return new Client($argc === 1 ? $argv[0] : $argv, $options);
-    }
-
     private static function filterClientOptions($options) {
         if ($options instanceof ClientOptions) {
             return $options;

+ 1 - 1
test/PredisShared.php

@@ -65,7 +65,7 @@ class RC {
         $handle = popen('php', 'w');
         fwrite($handle, "<?php
         require '../lib/Predis.php';
-        \$redis = Predis\Client::create('$redisUri');
+        \$redis = new Predis\Client('$redisUri');
         \$redis->rpush('{$op}1', 'a');
         \$redis->rpush('{$op}2', 'b');
         \$redis->rpush('{$op}3', 'c');