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
Push — master ( fcfb9f...a4817e )
by sunsky
01:47
created
src/MultiRequest.php 2 patches
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;
19
-    protected static $multiHandler;
20
-    private static $instance;
18
+	protected static $requestPool;
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(): MultiRequest
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(): MultiRequest
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(): void
36
-    {
37
-        self::$multiHandler = curl_multi_init();
38
-    }
35
+	protected static function prepare(): void
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 = null;
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 = null;
106
+		return $return;
107
+	}
108 108
 
109 109
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 'method' => $method,
44 44
                 'url' => $uri,
45 45
                 'data' => $payload,
46
-            ) + $options;
46
+            )+$options;
47 47
         $this->addOptions(array($options));
48 48
         return $this;
49 49
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function execute()
82 82
     {
83
-        $sleepTime = 1000;//microsecond, prevent  CPU 100%
83
+        $sleepTime = 1000; //microsecond, prevent  CPU 100%
84 84
         do {
85 85
             curl_multi_exec(self::$multiHandler, $active);
86 86
             // bug in PHP 5.3.18+ where curl_multi_select can return -1
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 usleep($sleepTime);
90 90
             }
91 91
             usleep($sleepTime);
92
-        } while ($active);
92
+        }while ($active);
93 93
         $return = array();
94 94
         foreach (self::$requestPool as $request) {
95 95
             $response = $request->makeResponse(true);
Please login to merge, or discard this patch.