GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Pull Request — master (#1)
by
unknown
05:38
created
src/MultiRequest.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -15,95 +15,95 @@
 block discarded – undo
15 15
  */
16 16
 class MultiRequest
17 17
 {
18
-    protected static $requestPool = array();
19
-    protected static $multiHandler;
20
-    private static $instance;
18
+	protected static $requestPool = array();
19
+	protected static $multiHandler;
20
+	private static $instance;
21 21
 
22
-    protected function __construct()
23
-    {
24
-    }
22
+	protected function __construct()
23
+	{
24
+	}
25 25
 
26
-    public static function create()
27
-    {
28
-        if (!(self::$instance instanceof self)) {
29
-            self::$instance = new self;
30
-        }
31
-        self::prepare();
32
-        return self::$instance;
33
-    }
26
+	public static function create()
27
+	{
28
+		if (!(self::$instance instanceof self)) {
29
+			self::$instance = new self;
30
+		}
31
+		self::prepare();
32
+		return self::$instance;
33
+	}
34 34
 
35
-    protected static function prepare()
36
-    {
37
-        self::$multiHandler = curl_multi_init();
38
-    }
35
+	protected static function prepare()
36
+	{
37
+		self::$multiHandler = curl_multi_init();
38
+	}
39 39
 
40
-    public function add($method, $uri, $payload, array $options = array())
41
-    {
42
-        $options = array(
43
-                'method' => $method,
44
-                'url' => $uri,
45
-                'data' => $payload,
46
-            ) + $options;
47
-        $this->addOptions(array($options));
48
-        return $this;
49
-    }
40
+	public function add($method, $uri, $payload, array $options = array())
41
+	{
42
+		$options = array(
43
+				'method' => $method,
44
+				'url' => $uri,
45
+				'data' => $payload,
46
+			) + $options;
47
+		$this->addOptions(array($options));
48
+		return $this;
49
+	}
50 50
 
51
-    /**
52
-     * @param array $URLOptions
53
-     * example: array(array('url'=>'http://localhost:9999/','timeout'=>1, 'method'=>'POST', 'data'=>'aa=bb&c=d'))
54
-     * @return $this
55
-     */
56
-    public function addOptions(array $URLOptions)
57
-    {
58
-        foreach ($URLOptions as $options) {
59
-            $request = Request::create()->addOptions($options)->applyOptions();
60
-            if (isset($options['callback'])) {
61
-                $request->onEnd($options['callback']);
62
-            }
63
-            $this->import($request);
64
-        }
65
-        return $this;
66
-    }
51
+	/**
52
+	 * @param array $URLOptions
53
+	 * example: array(array('url'=>'http://localhost:9999/','timeout'=>1, 'method'=>'POST', 'data'=>'aa=bb&c=d'))
54
+	 * @return $this
55
+	 */
56
+	public function addOptions(array $URLOptions)
57
+	{
58
+		foreach ($URLOptions as $options) {
59
+			$request = Request::create()->addOptions($options)->applyOptions();
60
+			if (isset($options['callback'])) {
61
+				$request->onEnd($options['callback']);
62
+			}
63
+			$this->import($request);
64
+		}
65
+		return $this;
66
+	}
67 67
 
68
-    public function import(Request $request)
69
-    {
70
-        if (!is_resource($request->curlHandle)) {
71
-            throw new InvalidArgumentException('Request curl handle is not initialized');
72
-        }
73
-        curl_multi_add_handle(self::$multiHandler, $request->curlHandle);
74
-        self::$requestPool[] = $request;
75
-        return $this;
76
-    }
68
+	public function import(Request $request)
69
+	{
70
+		if (!is_resource($request->curlHandle)) {
71
+			throw new InvalidArgumentException('Request curl handle is not initialized');
72
+		}
73
+		curl_multi_add_handle(self::$multiHandler, $request->curlHandle);
74
+		self::$requestPool[] = $request;
75
+		return $this;
76
+	}
77 77
 
78
-    /**
79
-     * @return array(Response)
80
-     */
81
-    public function execute()
82
-    {
83
-        $sleepTime = 1000;//microsecond, prevent  CPU 100%
84
-        do {
85
-            curl_multi_exec(self::$multiHandler, $active);
86
-            // bug in PHP 5.3.18+ where curl_multi_select can return -1
87
-            // https://bugs.php.net/bug.php?id=63411
88
-            if (curl_multi_select(self::$multiHandler) == -1) {
89
-                usleep($sleepTime);
90
-            }
91
-            usleep($sleepTime);
92
-        } while ($active);
93
-        $return = array();
94
-        foreach (self::$requestPool as $request) {
95
-            $response = $request->makeResponse(true);
96
-            $func = $response->request->endCallback();
97
-            if (isset($func)) {
98
-                $func($response);
99
-            }
100
-            $return[] = $response;
101
-            curl_multi_remove_handle(self::$multiHandler, $request->curlHandle);
102
-            curl_close($request->curlHandle);
103
-        }
104
-        curl_multi_close(self::$multiHandler);
105
-        self::$requestPool = array();
106
-        return $return;
107
-    }
78
+	/**
79
+	 * @return array(Response)
80
+	 */
81
+	public function execute()
82
+	{
83
+		$sleepTime = 1000;//microsecond, prevent  CPU 100%
84
+		do {
85
+			curl_multi_exec(self::$multiHandler, $active);
86
+			// bug in PHP 5.3.18+ where curl_multi_select can return -1
87
+			// https://bugs.php.net/bug.php?id=63411
88
+			if (curl_multi_select(self::$multiHandler) == -1) {
89
+				usleep($sleepTime);
90
+			}
91
+			usleep($sleepTime);
92
+		} while ($active);
93
+		$return = array();
94
+		foreach (self::$requestPool as $request) {
95
+			$response = $request->makeResponse(true);
96
+			$func = $response->request->endCallback();
97
+			if (isset($func)) {
98
+				$func($response);
99
+			}
100
+			$return[] = $response;
101
+			curl_multi_remove_handle(self::$multiHandler, $request->curlHandle);
102
+			curl_close($request->curlHandle);
103
+		}
104
+		curl_multi_close(self::$multiHandler);
105
+		self::$requestPool = array();
106
+		return $return;
107
+	}
108 108
 
109 109
 }
Please login to merge, or discard this patch.