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.
Passed
Push — master ( 46173d...e42f18 )
by Steeven
03:15
created
src/Request.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -75,28 +75,28 @@  discard block
 block discarded – undo
75 75
         }
76 76
 
77 77
         // default, TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.
78
-        $this->curlOptions[ CURLOPT_RETURNTRANSFER ] = true;
78
+        $this->curlOptions[CURLOPT_RETURNTRANSFER] = true;
79 79
 
80 80
         // default, TRUE to output verbose information.
81
-        $this->curlOptions[ CURLOPT_VERBOSE ] = true;
81
+        $this->curlOptions[CURLOPT_VERBOSE] = true;
82 82
 
83 83
         // default, TRUE to include the header in the output.
84
-        $this->curlOptions[ CURLOPT_HEADER ] = true;
84
+        $this->curlOptions[CURLOPT_HEADER] = true;
85 85
 
86 86
         // default, lets CURL decide which version to use.
87
-        $this->curlOptions[ CURLOPT_HTTP_VERSION ] = CURL_HTTP_VERSION_NONE;
87
+        $this->curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_NONE;
88 88
 
89 89
         // default, http user agent using o2system curl.
90
-        $this->curlOptions[ CURLOPT_USERAGENT ] = 'Curl/1.0 (O2System)';
90
+        $this->curlOptions[CURLOPT_USERAGENT] = 'Curl/1.0 (O2System)';
91 91
 
92 92
         // default, TRUE to automatically set the Referer: field in requests where it follows a Location: redirect.
93
-        $this->curlOptions[ CURLOPT_AUTOREFERER ] = true;
93
+        $this->curlOptions[CURLOPT_AUTOREFERER] = true;
94 94
 
95 95
         // default, FALSE to stop cURL from verifying the peer's certificate.
96
-        $this->curlOptions[ CURLOPT_SSL_VERIFYPEER ] = false;
96
+        $this->curlOptions[CURLOPT_SSL_VERIFYPEER] = false;
97 97
 
98 98
         // default, 0 to not check the names.
99
-        $this->curlOptions[ CURLOPT_SSL_VERIFYHOST ] = 0;
99
+        $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = 0;
100 100
     }
101 101
 
102 102
     // ------------------------------------------------------------------------
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public function setOption($option, $value)
139 139
     {
140
-        $this->curlOptions[ $option ] = $value;
140
+        $this->curlOptions[$option] = $value;
141 141
 
142 142
         return $this;
143 143
     }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 CURL_HTTP_VERSION_2,
180 180
             ]
181 181
         )) {
182
-            $this->curlOptions[ CURLOPT_HTTP_VERSION ] = $httpVersion;
182
+            $this->curlOptions[CURLOPT_HTTP_VERSION] = $httpVersion;
183 183
         }
184 184
 
185 185
         return $this;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function setUserAgent($userAgent)
200 200
     {
201
-        $this->curlOptions[ CURLOPT_USERAGENT ] = trim($userAgent);
201
+        $this->curlOptions[CURLOPT_USERAGENT] = trim($userAgent);
202 202
 
203 203
         return $this;
204 204
     }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
      */
217 217
     public function setReferer($referer)
218 218
     {
219
-        $this->curlOptions[ CURLOPT_REFERER ] = trim($referer);
219
+        $this->curlOptions[CURLOPT_REFERER] = trim($referer);
220 220
 
221 221
         return $this;
222 222
     }
@@ -237,9 +237,9 @@  discard block
 block discarded – undo
237 237
     public function setEncoding($encoding)
238 238
     {
239 239
         if (in_array($encoding, ['identity', 'deflate', 'gzip'])) {
240
-            $this->curlOptions[ CURLOPT_ENCODING ] = $encoding;
240
+            $this->curlOptions[CURLOPT_ENCODING] = $encoding;
241 241
         } else {
242
-            $this->curlOptions[ CURLOPT_ENCODING ] = '';
242
+            $this->curlOptions[CURLOPT_ENCODING] = '';
243 243
         }
244 244
 
245 245
         return $this;
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
     public function setTimeout($timeout, $isMilliseconds = false)
261 261
     {
262 262
         if ($isMilliseconds) {
263
-            $this->curlOptions[ CURLOPT_TIMEOUT_MS ] = (int)$timeout;
263
+            $this->curlOptions[CURLOPT_TIMEOUT_MS] = (int) $timeout;
264 264
         } else {
265
-            $this->curlOptions[ CURLOPT_TIMEOUT ] = (int)$timeout;
265
+            $this->curlOptions[CURLOPT_TIMEOUT] = (int) $timeout;
266 266
         }
267 267
 
268 268
         return $this;
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
     public function setConnectionTimeout($timeout, $isMilliseconds = false)
284 284
     {
285 285
         if ($isMilliseconds) {
286
-            $this->curlOptions[ CURLOPT_CONNECTTIMEOUT_MS ] = (int)$timeout;
286
+            $this->curlOptions[CURLOPT_CONNECTTIMEOUT_MS] = (int) $timeout;
287 287
         } else {
288
-            $this->curlOptions[ CURLOPT_CONNECTTIMEOUT ] = (int)$timeout;
288
+            $this->curlOptions[CURLOPT_CONNECTTIMEOUT] = (int) $timeout;
289 289
         }
290 290
 
291 291
         return $this;
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
      */
305 305
     public function setMaximumRedirects($maximum)
306 306
     {
307
-        $this->curlOptions[ CURLOPT_MAXREDIRS ] = (int)$maximum;
308
-        $this->curlOptions[ CURLOPT_FOLLOWLOCATION ] = true;
307
+        $this->curlOptions[CURLOPT_MAXREDIRS] = (int) $maximum;
308
+        $this->curlOptions[CURLOPT_FOLLOWLOCATION] = true;
309 309
 
310 310
         return $this;
311 311
     }
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
     {
331 331
         if (is_file($caInfoFilePath)) {
332 332
             $this->setSslVerify(2, true);
333
-            $this->curlOptions[ CURLOPT_CAINFO ] = pathinfo($caInfoFilePath, PATHINFO_BASENAME);
334
-            $this->curlOptions[ CURLOPT_CAPATH ] = dirname($caInfoFilePath);
333
+            $this->curlOptions[CURLOPT_CAINFO] = pathinfo($caInfoFilePath, PATHINFO_BASENAME);
334
+            $this->curlOptions[CURLOPT_CAPATH] = dirname($caInfoFilePath);
335 335
         }
336 336
 
337 337
         return $this;
@@ -355,11 +355,11 @@  discard block
 block discarded – undo
355 355
      */
356 356
     public function setSslVerify($verifyHost, $verifyStatus = false)
357 357
     {
358
-        $this->curlOptions[ CURLOPT_SSL_VERIFYPEER ] = true;
358
+        $this->curlOptions[CURLOPT_SSL_VERIFYPEER] = true;
359 359
 
360 360
         $verifyHost = in_array($verifyHost, range(0, 3)) ? $verifyHost : 0;
361
-        $this->curlOptions[ CURLOPT_SSL_VERIFYHOST ] = (int)$verifyHost;
362
-        $this->curlOptions[ CURLOPT_SSL_VERIFYSTATUS ] = (bool)$verifyStatus;
361
+        $this->curlOptions[CURLOPT_SSL_VERIFYHOST] = (int) $verifyHost;
362
+        $this->curlOptions[CURLOPT_SSL_VERIFYSTATUS] = (bool) $verifyStatus;
363 363
 
364 364
         return $this;
365 365
     }
@@ -386,11 +386,11 @@  discard block
 block discarded – undo
386 386
     public function setAuthentication($username = '', $password = '', $method = CURLAUTH_ANY)
387 387
     {
388 388
         if (defined('CURLOPT_USERNAME')) {
389
-            $this->curlOptions[ CURLOPT_USERNAME ] = $username;
389
+            $this->curlOptions[CURLOPT_USERNAME] = $username;
390 390
         }
391 391
 
392
-        $this->curlOptions[ CURLOPT_USERPWD ] = "$username:$password";
393
-        $this->curlOptions[ CURLOPT_HTTPAUTH ] = CURLAUTH_ANY;
392
+        $this->curlOptions[CURLOPT_USERPWD] = "$username:$password";
393
+        $this->curlOptions[CURLOPT_HTTPAUTH] = CURLAUTH_ANY;
394 394
 
395 395
         if (in_array($method, [
396 396
             CURLAUTH_BASIC,
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             CURLAUTH_ANY,
401 401
             CURLAUTH_ANYSAFE,
402 402
         ])) {
403
-            $this->curlOptions[ CURLOPT_HTTPAUTH ] = $method;
403
+            $this->curlOptions[CURLOPT_HTTPAUTH] = $method;
404 404
         }
405 405
 
406 406
         return $this;
@@ -427,10 +427,10 @@  discard block
 block discarded – undo
427 427
      */
428 428
     public function setProxy($address, $port = 1080, $type = CURLPROXY_HTTP)
429 429
     {
430
-        $this->curlOptions[ CURLOPT_PROXY ] = $address;
431
-        $this->curlOptions[ CURLOPT_PROXYPORT ] = $port;
432
-        $this->curlOptions[ CURLOPT_PROXYTYPE ] = $type;
433
-        $this->curlOptions[ CURLOPT_HTTPPROXYTUNNEL ] = true;
430
+        $this->curlOptions[CURLOPT_PROXY] = $address;
431
+        $this->curlOptions[CURLOPT_PROXYPORT] = $port;
432
+        $this->curlOptions[CURLOPT_PROXYTYPE] = $type;
433
+        $this->curlOptions[CURLOPT_HTTPPROXYTUNNEL] = true;
434 434
 
435 435
         return $this;
436 436
     }
@@ -453,16 +453,16 @@  discard block
 block discarded – undo
453 453
     public function setProxyAuthentication($username, $password, $method = CURLAUTH_BASIC)
454 454
     {
455 455
         if (array_key_exists(CURLOPT_HTTPPROXYTUNNEL, $this->curlOptions)) {
456
-            $this->curlOptions[ CURLOPT_PROXYUSERPWD ] = "$username:$password";
456
+            $this->curlOptions[CURLOPT_PROXYUSERPWD] = "$username:$password";
457 457
         }
458 458
 
459
-        $this->curlOptions[ CURLOPT_PROXYAUTH ] = CURLAUTH_BASIC;
459
+        $this->curlOptions[CURLOPT_PROXYAUTH] = CURLAUTH_BASIC;
460 460
 
461 461
         if (in_array($method, [
462 462
             CURLAUTH_BASIC,
463 463
             CURLAUTH_NTLM,
464 464
         ])) {
465
-            $this->curlOptions[ CURLOPT_PROXYAUTH ] = $method;
465
+            $this->curlOptions[CURLOPT_PROXYAUTH] = $method;
466 466
         }
467 467
 
468 468
         return $this;
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      */
503 503
     public function addHeader($name, $value)
504 504
     {
505
-        $this->curlHeaders[ $name ] = $value;
505
+        $this->curlHeaders[$name] = $value;
506 506
 
507 507
         return $this;
508 508
     }
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
      */
523 523
     public function setCookie($cookie)
524 524
     {
525
-        $this->curlOptions[ CURLOPT_COOKIE ] = $cookie;
525
+        $this->curlOptions[CURLOPT_COOKIE] = $cookie;
526 526
 
527 527
         return $this;
528 528
     }
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
     {
545 545
         if (is_file($cookieFile)) {
546 546
             $cookieJar = empty($cookieJar) ? $cookieFile : $cookieJar;
547
-            $this->curlOptions[ CURLOPT_COOKIEFILE ] = $cookieFile;
548
-            $this->curlOptions[ CURLOPT_COOKIEJAR ] = $cookieJar;
547
+            $this->curlOptions[CURLOPT_COOKIEFILE] = $cookieFile;
548
+            $this->curlOptions[CURLOPT_COOKIEJAR] = $cookieJar;
549 549
         }
550 550
 
551 551
         return $this;
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
     {
567 567
         $this->uri = $this->uri->withQuery($query);
568 568
 
569
-        $this->curlOptions[ CURLOPT_HTTPGET ] = true;
569
+        $this->curlOptions[CURLOPT_HTTPGET] = true;
570 570
 
571 571
         return $this->getResponse();
572 572
     }
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                 $headers[] = trim($key) . ': ' . trim($value);
595 595
             }
596 596
 
597
-            $this->curlOptions[ CURLOPT_HTTPHEADER ] = $headers;
597
+            $this->curlOptions[CURLOPT_HTTPHEADER] = $headers;
598 598
         }
599 599
 
600 600
         if (curl_setopt_array($handle, $this->curlOptions)) {
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
      */
626 626
     public function post(array $fields = [], $json = false)
627 627
     {
628
-        $this->curlOptions[ CURLOPT_POST ] = true;
628
+        $this->curlOptions[CURLOPT_POST] = true;
629 629
 
630 630
         if ($json === true) {
631
-            $this->curlOptions[ CURLOPT_POSTFIELDS ] = json_encode($fields);
631
+            $this->curlOptions[CURLOPT_POSTFIELDS] = json_encode($fields);
632 632
             $this->addHeader('Content-Type', 'application/json');
633
-            $this->addHeader('Content-Length', strlen($this->curlOptions[ CURLOPT_POSTFIELDS ]));
633
+            $this->addHeader('Content-Length', strlen($this->curlOptions[CURLOPT_POSTFIELDS]));
634 634
         } else {
635
-            $this->curlOptions[ CURLOPT_POSTFIELDS ] = http_build_query($fields, null, '&', PHP_QUERY_RFC3986);
635
+            $this->curlOptions[CURLOPT_POSTFIELDS] = http_build_query($fields, null, '&', PHP_QUERY_RFC3986);
636 636
         }
637 637
 
638 638
         return $this->getResponse();
@@ -651,11 +651,11 @@  discard block
 block discarded – undo
651 651
      */
652 652
     public function delete(array $fields = [])
653 653
     {
654
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'DELETE';
654
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'DELETE';
655 655
 
656 656
         if (count($fields)) {
657
-            $this->curlOptions[ CURLOPT_POST ] = true;
658
-            $this->curlOptions[ CURLOPT_POSTFIELDS ] = http_build_query($fields, null, '&', PHP_QUERY_RFC3986);
657
+            $this->curlOptions[CURLOPT_POST] = true;
658
+            $this->curlOptions[CURLOPT_POSTFIELDS] = http_build_query($fields, null, '&', PHP_QUERY_RFC3986);
659 659
         }
660 660
 
661 661
         return $this->getResponse();
@@ -672,10 +672,10 @@  discard block
 block discarded – undo
672 672
      */
673 673
     public function head()
674 674
     {
675
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'HEAD';
676
-        $this->curlOptions[ CURLOPT_HTTPGET ] = true;
677
-        $this->curlOptions[ CURLOPT_HEADER ] = true;
678
-        $this->curlOptions[ CURLOPT_NOBODY ] = true;
675
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'HEAD';
676
+        $this->curlOptions[CURLOPT_HTTPGET] = true;
677
+        $this->curlOptions[CURLOPT_HEADER] = true;
678
+        $this->curlOptions[CURLOPT_NOBODY] = true;
679 679
 
680 680
         return $this->getResponse();
681 681
     }
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
      */
692 692
     public function trace()
693 693
     {
694
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'TRACE';
694
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'TRACE';
695 695
 
696 696
         return $this->getResponse();
697 697
     }
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
      */
708 708
     public function options()
709 709
     {
710
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'OPTIONS';
710
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'OPTIONS';
711 711
 
712 712
         return $this->getResponse();
713 713
     }
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
      */
724 724
     public function patch()
725 725
     {
726
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'PATCH';
726
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'PATCH';
727 727
 
728 728
         return $this->getResponse();
729 729
     }
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
      */
740 740
     public function connect()
741 741
     {
742
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'CONNECT';
742
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'CONNECT';
743 743
 
744 744
         return $this->getResponse();
745 745
     }
@@ -755,9 +755,9 @@  discard block
 block discarded – undo
755 755
      */
756 756
     public function download()
757 757
     {
758
-        $this->curlOptions[ CURLOPT_CUSTOMREQUEST ] = 'DOWNLOAD';
759
-        $this->curlOptions[ CURLOPT_BINARYTRANSFER ] = true;
760
-        $this->curlOptions[ CURLOPT_RETURNTRANSFER ] = false;
758
+        $this->curlOptions[CURLOPT_CUSTOMREQUEST] = 'DOWNLOAD';
759
+        $this->curlOptions[CURLOPT_BINARYTRANSFER] = true;
760
+        $this->curlOptions[CURLOPT_RETURNTRANSFER] = false;
761 761
 
762 762
         return $this->getResponse();
763 763
     }
@@ -774,11 +774,11 @@  discard block
 block discarded – undo
774 774
     public function getHandle()
775 775
     {
776 776
         if ($this->curlAutoClose) {
777
-            $this->curlOptions[ CURLOPT_FORBID_REUSE ] = true;
778
-            $this->curlOptions[ CURLOPT_FRESH_CONNECT ] = true;
777
+            $this->curlOptions[CURLOPT_FORBID_REUSE] = true;
778
+            $this->curlOptions[CURLOPT_FRESH_CONNECT] = true;
779 779
         }
780 780
 
781
-        $this->curlOptions[ CURLOPT_URL ] = $this->uri->__toString();
781
+        $this->curlOptions[CURLOPT_URL] = $this->uri->__toString();
782 782
 
783 783
         $handle = curl_init($this->uri->__toString());
784 784
 
Please login to merge, or discard this patch.