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.
Completed
Push — master ( 8eeac2...c7d448 )
by Nathan
10s
created
src/Parser.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     /**
96 96
      * Determine if the payload contains a non-empty value for a given key.
97 97
      *
98
-     * @param  string|array $keys
98
+     * @param  string|null $keys
99 99
      *
100 100
      * @return bool
101 101
      */
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
     /**
357 357
      * Return a value from the array identified from the key.
358 358
      *
359
-     * @param $key
359
+     * @param string|null $key
360 360
      * @param $data
361 361
      * @return mixed
362 362
      */
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,31 +29,31 @@
 block discarded – undo
29 29
      * @var array Supported Formats
30 30
      */
31 31
     private $supported_formats = [
32
-      // XML
32
+        // XML
33 33
         'application/xml' => XML::class,
34 34
         'text/xml'        => XML::class,
35 35
         'xml'             => XML::class,
36
-      // JSON
36
+        // JSON
37 37
         'application/json'         => JSON::class,
38 38
         'application/x-javascript' => JSON::class,
39 39
         'text/javascript'          => JSON::class,
40 40
         'text/x-javascript'        => JSON::class,
41 41
         'text/x-json'              => JSON::class,
42 42
         'json'                     => JSON::class,
43
-      // BSON
43
+        // BSON
44 44
         'application/bson' => BSON::class,
45 45
         'bson'             => BSON::class,
46
-      // YAML
46
+        // YAML
47 47
         'text/yaml'          => YAML::class,
48 48
         'text/x-yaml'        => YAML::class,
49 49
         'application/yaml'   => YAML::class,
50 50
         'application/x-yaml' => YAML::class,
51 51
         'yaml'               => YAML::class,
52
-      // MSGPACK
52
+        // MSGPACK
53 53
         'application/msgpack'   => MSGPack::class,
54 54
         'application/x-msgpack' => MSGPack::class,
55 55
         'msgpack'               => MSGPack::class,
56
-      // MISC
56
+        // MISC
57 57
         'application/vnd.php.serialized'    => Serialize::class,
58 58
         'serialize'                         => Serialize::class,
59 59
         'application/x-www-form-urlencoded' => QueryStr::class,
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $keys = [];
149 149
         foreach ($mask as $key => $value) {
150
-            $keys[] = $key . (is_array($value) ? $this->processMask($value) : '');
150
+            $keys[] = $key.(is_array($value) ? $this->processMask($value) : '');
151 151
         }
152 152
 
153 153
         return $this->only($keys);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     private function processMask($mask)
164 164
     {
165 165
         foreach ($mask as $key => $value) {
166
-            return '.' . $key . (is_array($value) ? $this->processMask($value) : '');
166
+            return '.'.$key.(is_array($value) ? $this->processMask($value) : '');
167 167
         }
168 168
     }
169 169
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function getFormatClass($format = '')
200 200
     {
201
-        if ( ! empty($format)) {
201
+        if (!empty($format)) {
202 202
             return $this->processContentType($format);
203 203
         }
204 204
 
@@ -277,10 +277,10 @@  discard block
 block discarded – undo
277 277
      */
278 278
     public function registerFormat($format, $class)
279 279
     {
280
-        if ( ! class_exists($class)) {
280
+        if (!class_exists($class)) {
281 281
             throw new \InvalidArgumentException("Parser formatter class {$class} not found.");
282 282
         }
283
-        if ( ! is_a($class, 'Nathanmac\Utilities\Parser\Formats\FormatInterface', true)) {
283
+        if (!is_a($class, 'Nathanmac\Utilities\Parser\Formats\FormatInterface', true)) {
284 284
             throw new \InvalidArgumentException('Parser formatters must implement the Nathanmac\Utilities\Parser\Formats\FormatInterface interface.');
285 285
         }
286 286
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             $key = array_shift($keys);
404 404
 
405 405
             // Wildcard Key
406
-            if (preg_match($this->wildcards, $key) && is_array($data) && ! empty($data)) {
406
+            if (preg_match($this->wildcards, $key) && is_array($data) && !empty($data)) {
407 407
                 // Shift the first item of the array
408 408
                 if (preg_match('/^:(index|item)\[\d+\]$/', $key)) {
409 409
                     for ($x = substr($key, 7, -1); $x >= 0; $x--) {
@@ -417,13 +417,13 @@  discard block
 block discarded – undo
417 417
                 } else {
418 418
                     $item = array_shift($data);
419 419
                 }
420
-                $data =& $item;
420
+                $data = & $item;
421 421
             } else {
422
-                if ( ! isset($data[$key]) || ! is_array($data[$key])) {
422
+                if (!isset($data[$key]) || !is_array($data[$key])) {
423 423
                     return false;
424 424
                 }
425 425
 
426
-                $data =& $data[$key];
426
+                $data = & $data[$key];
427 427
             }
428 428
         }
429 429
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             $key = array_shift($keys);
462 462
 
463 463
             // Wildcard Key
464
-            if (preg_match($this->wildcards, $key) && is_array($data) && ! empty($data)) {
464
+            if (preg_match($this->wildcards, $key) && is_array($data) && !empty($data)) {
465 465
                 // Shift the first item of the array
466 466
                 if (preg_match('/^:(index|item)\[\d+\]$/', $key)) {
467 467
                     for ($x = substr($key, 7, -1); $x >= 0; $x--) {
@@ -475,9 +475,9 @@  discard block
 block discarded – undo
475 475
                 } else {
476 476
                     $item = array_shift($data);
477 477
                 }
478
-                $data =& $item;
478
+                $data = & $item;
479 479
             } else {
480
-                if ( ! isset($data[$key])) {
480
+                if (!isset($data[$key])) {
481 481
                     return false;
482 482
                 }
483 483
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
                     return false;
490 490
                 }
491 491
 
492
-                $data =& $data[$key];
492
+                $data = & $data[$key];
493 493
             }
494 494
         }
495 495
         return true;
@@ -525,11 +525,11 @@  discard block
 block discarded – undo
525 525
         while (count($keys) > 1) {
526 526
             $key = array_shift($keys);
527 527
 
528
-            if ( ! isset($array[$key]) || ! is_array($array[$key])) {
528
+            if (!isset($array[$key]) || !is_array($array[$key])) {
529 529
                 return;
530 530
             }
531 531
 
532
-            $array =& $array[$key];
532
+            $array = & $array[$key];
533 533
         }
534 534
 
535 535
         unset($array[array_shift($keys)]);
Please login to merge, or discard this patch.
src/ParserServiceProvider.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     /**
36 36
      * Get the services provided by the provider.
37 37
      *
38
-     * @return array
38
+     * @return string[]
39 39
      */
40 40
     public function provides()
41 41
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function register()
29 29
     {
30
-        $this->app->bind('Parser', function ($app) {
30
+        $this->app->bind('Parser', function($app) {
31 31
             return new Parser;
32 32
         });
33 33
     }
Please login to merge, or discard this patch.
src/Formats/JSON.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     {
27 27
         if ($payload) {
28 28
             $json = json_decode(trim($payload), true);
29
-            if ( ! $json) {
29
+            if (!$json) {
30 30
                 throw new ParserException('Failed To Parse JSON');
31 31
             }
32 32
             return $json;
Please login to merge, or discard this patch.
src/Formats/BSONPolyfill.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! function_exists('bson_decode')) {
3
+if (!function_exists('bson_decode')) {
4 4
     function bson_decode($payload)
5 5
     {
6 6
         return MongoDB\BSON\toPHP($payload, ['root' => 'array', 'document' => 'array']);
Please login to merge, or discard this patch.
src/Formats/BSON.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,25 +24,25 @@
 block discarded – undo
24 24
      */
25 25
     public function parse($payload)
26 26
     {
27
-        if (function_exists('MongoDB\BSON\toPHP') && ! function_exists('bson_decode')) {
28
-            require_once(__DIR__ . '/BSONPolyfill.php');  //@codeCoverageIgnore
29
-        } elseif ( ! (function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP'))) {
30
-            throw new ParserException('Failed To Parse BSON - Supporting Library Not Available');  // @codeCoverageIgnore
27
+        if (function_exists('MongoDB\BSON\toPHP') && !function_exists('bson_decode')) {
28
+            require_once(__DIR__.'/BSONPolyfill.php'); //@codeCoverageIgnore
29
+        } elseif (!(function_exists('bson_decode') || function_exists('MongoDB\BSON\toPHP'))) {
30
+            throw new ParserException('Failed To Parse BSON - Supporting Library Not Available'); // @codeCoverageIgnore
31 31
         }
32 32
 
33 33
         if ($payload) {
34
-            $prevHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {
35
-                throw new \Exception($errstr);  // @codeCoverageIgnore
34
+            $prevHandler = set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) {
35
+                throw new \Exception($errstr); // @codeCoverageIgnore
36 36
             });
37 37
 
38 38
             try {
39
-                $bson = bson_decode(trim($payload, " \t\n\r\x0b"));  // Don't trim \0, as it has valid meaning in BSON
40
-                if ( ! $bson) {
41
-                    throw new \Exception('Unknown error');  // @codeCoverageIgnore
39
+                $bson = bson_decode(trim($payload, " \t\n\r\x0b")); // Don't trim \0, as it has valid meaning in BSON
40
+                if (!$bson) {
41
+                    throw new \Exception('Unknown error'); // @codeCoverageIgnore
42 42
                 }
43 43
             } catch (\Exception $e) {
44 44
                 set_error_handler($prevHandler);
45
-                throw new ParserException('Failed To Parse BSON - ' . $e->getMessage());
45
+                throw new ParserException('Failed To Parse BSON - '.$e->getMessage());
46 46
             }
47 47
 
48 48
             set_error_handler($prevHandler);
Please login to merge, or discard this patch.
src/Formats/MSGPack.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
     {
27 27
         if (function_exists('msgpack_unpack')) {
28 28
             if ($payload) {
29
-                $prevHandler = set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {
30
-                    throw new \Exception($errstr);  // @codeCoverageIgnore
29
+                $prevHandler = set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) {
30
+                    throw new \Exception($errstr); // @codeCoverageIgnore
31 31
                 });
32 32
 
33 33
                 try {
34 34
                     $msg = msgpack_unpack(trim($payload));
35
-                    if ( ! $msg) {
36
-                        throw new \Exception('Unknown error');  // @codeCoverageIgnore
35
+                    if (!$msg) {
36
+                        throw new \Exception('Unknown error'); // @codeCoverageIgnore
37 37
                     }
38 38
                 } catch (\Exception $e) {
39 39
                     set_error_handler($prevHandler);
40
-                    throw new ParserException('Failed To Parse MSGPack - ' . $e->getMessage());
40
+                    throw new ParserException('Failed To Parse MSGPack - '.$e->getMessage());
41 41
                 }
42 42
 
43 43
                 set_error_handler($prevHandler);
@@ -47,6 +47,6 @@  discard block
 block discarded – undo
47 47
             return [];
48 48
         }
49 49
 
50
-        throw new ParserException('Failed To Parse MSGPack - Supporting Library Not Available');  // @codeCoverageIgnore
50
+        throw new ParserException('Failed To Parse MSGPack - Supporting Library Not Available'); // @codeCoverageIgnore
51 51
     }
52 52
 }
Please login to merge, or discard this patch.
src/Formats/XML.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
     protected function recursive_parse($xml, $ns)
41 41
     {
42
-        $xml_string = (string)$xml;
42
+        $xml_string = (string) $xml;
43 43
 
44 44
         if ($xml->count() == 0 and $xml_string != '') {
45 45
             if (count($xml->attributes()) == 0) {
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                     $attName = "{$nsName}:{$attName}";
62 62
                 }
63 63
 
64
-                $result["@{$attName}"] = (string)$attValue;
64
+                $result["@{$attName}"] = (string) $attValue;
65 65
             }
66 66
 
67 67
             foreach ($xml->children($nsUri) as $childName => $child) {
Please login to merge, or discard this patch.