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
Pull Request — master (#235)
by
unknown
07:06
created
src/Audit.php 1 patch
Braces   +44 added lines, -33 removed lines patch added patch discarded remove patch
@@ -239,8 +239,9 @@  discard block
 block discarded – undo
239 239
      */
240 240
     public function registerFunction($name, $callback)
241 241
     {
242
-        if (isset($this->_panelFunctions[$name]))
243
-            throw new InvalidParamException("The '$name'-function has already been defined.");
242
+        if (isset($this->_panelFunctions[$name])) {
243
+                    throw new InvalidParamException("The '$name'-function has already been defined.");
244
+        }
244 245
 
245 246
         $this->_panelFunctions[$name] = $callback;
246 247
     }
@@ -260,8 +261,9 @@  discard block
 block discarded – undo
260 261
      */
261 262
     public function __call($name, $params)
262 263
     {
263
-        if (!isset($this->_panelFunctions[$name]))
264
-            throw new \yii\base\InvalidCallException("Unknown panel function '$name'");
264
+        if (!isset($this->_panelFunctions[$name])) {
265
+                    throw new \yii\base\InvalidCallException("Unknown panel function '$name'");
266
+        }
265 267
 
266 268
         return call_user_func_array($this->_panelFunctions[$name], $params);
267 269
     }
@@ -333,13 +335,15 @@  discard block
 block discarded – undo
333 335
     public function getPanel($identifier)
334 336
     {
335 337
         $config = null;
336
-        if (isset($this->panels[$identifier]))
337
-            $config = $this->panels[$identifier];
338
-        elseif (isset($this->_corePanels[$identifier]))
339
-            $config = $this->_corePanels[$identifier];
338
+        if (isset($this->panels[$identifier])) {
339
+                    $config = $this->panels[$identifier];
340
+        } elseif (isset($this->_corePanels[$identifier])) {
341
+                    $config = $this->_corePanels[$identifier];
342
+        }
340 343
 
341
-        if (!$config)
342
-            throw new InvalidConfigException("'$identifier' is not a valid panel identifier");
344
+        if (!$config) {
345
+                    throw new InvalidConfigException("'$identifier' is not a valid panel identifier");
346
+        }
343 347
 
344 348
         if (is_array($config)) {
345 349
             $config['module'] = $this;
@@ -360,11 +364,11 @@  discard block
 block discarded – undo
360 364
         foreach ($this->panels as $key => $value) {
361 365
             if (is_numeric($key)) {
362 366
                 // The $value contains the identifier of a core panel
363
-                if (!isset($this->_corePanels[$value]))
364
-                    throw new InvalidConfigException("'$value' is not a valid panel identifier");
367
+                if (!isset($this->_corePanels[$value])) {
368
+                                    throw new InvalidConfigException("'$value' is not a valid panel identifier");
369
+                }
365 370
                 $panels[$value] = $this->_corePanels[$value];
366
-            }
367
-            else {
371
+            } else {
368 372
                 // The key contains the identifier and the value is either a class name or a full array
369 373
                 $panels[$key] = is_string($value) ? ['class' => $value] : $value;
370 374
             }
@@ -374,10 +378,11 @@  discard block
 block discarded – undo
374 378
         // We now need one more iteration to add core classes to the panels added via the merge, if needed
375 379
         array_walk($this->panels, function(&$value, $key) {
376 380
            if (!isset($value['class'])) {
377
-               if (isset($this->_corePanels[$key]))
378
-                   $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
379
-               else
380
-                   throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
381
+               if (isset($this->_corePanels[$key])) {
382
+                                  $value = ArrayHelper::merge($value, $this->_corePanels[$key]);
383
+               } else {
384
+                                  throw new InvalidConfigException("Invalid configuration for '$key'. No 'class' specified.");
385
+               }
381 386
            }
382 387
         });
383 388
     }
@@ -389,18 +394,21 @@  discard block
 block discarded – undo
389 394
     {
390 395
         foreach (Yii::$app->modules as $name => $module) {
391 396
             $class = null;
392
-            if (is_string($module))
393
-                $class = $module;
394
-            elseif (is_array($module)) {
395
-                if (isset($module['class']))
396
-                    $class = $module['class'];
397
-            } else
398
-                /** @var Module $module */
397
+            if (is_string($module)) {
398
+                            $class = $module;
399
+            } elseif (is_array($module)) {
400
+                if (isset($module['class'])) {
401
+                                    $class = $module['class'];
402
+                }
403
+            } else {
404
+                            /** @var Module $module */
399 405
                 $class = $module::className();
406
+            }
400 407
 
401 408
             $parts = explode('\\', $class);
402
-            if ($class && strtolower(end($parts)) == 'audit')
403
-                return $name;
409
+            if ($class && strtolower(end($parts)) == 'audit') {
410
+                            return $name;
411
+            }
404 412
         }
405 413
         return null;
406 414
     }
@@ -436,18 +444,21 @@  discard block
 block discarded – undo
436 444
             $len = strlen($compare);
437 445
             if ($compare[$len - 1] == '*') {
438 446
                 $compare = rtrim($compare, '*');
439
-                if (substr($route, 0, $len - 1) === $compare)
440
-                    return true;
447
+                if (substr($route, 0, $len - 1) === $compare) {
448
+                                    return true;
449
+                }
441 450
             }
442 451
 
443 452
             if ($compare[0] == '*') {
444 453
                 $compare = ltrim($compare, '*');
445
-                if (substr($route, - ($len - 1)) === $compare)
446
-                    return true;
454
+                if (substr($route, - ($len - 1)) === $compare) {
455
+                                    return true;
456
+                }
447 457
             }
448 458
 
449
-            if ($route === $compare)
450
-                return true;
459
+            if ($route === $compare) {
460
+                            return true;
461
+            }
451 462
         }
452 463
         return false;
453 464
     }
Please login to merge, or discard this patch.
src/views/entry/panels/soap/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,6 @@
 block discarded – undo
6 6
 
7 7
 echo Html::tag('h1', $panel->name);
8 8
 
9
-foreach ($dataProvider->allModels as $index => $request)
9
+foreach ($dataProvider->allModels as $index => $request) {
10 10
     echo $this->render('detail', ['panel' => $panel, 'request' => $request, 'index' => $index + 1]);
11
+}
Please login to merge, or discard this patch.
src/AuditTrailBehavior.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,13 +237,15 @@
 block discarded – undo
237 237
         $oldAttributes = $this->cleanAttributes($this->getOldAttributes());
238 238
 
239 239
         // ensure to handle serialized attributes properly
240
-        foreach($newAttributes as $key => $value)
241
-            if(is_array($newAttributes[$key]))
240
+        foreach($newAttributes as $key => $value) {
241
+                    if(is_array($newAttributes[$key]))
242 242
                 $newAttributes[$key] = Json::encode($newAttributes[$key]);
243
+        }
243 244
 
244
-        foreach($oldAttributes as $key => $value)
245
-            if(is_array($oldAttributes[$key]))
245
+        foreach($oldAttributes as $key => $value) {
246
+                    if(is_array($oldAttributes[$key]))
246 247
                 $oldAttributes[$key] = Json::encode($oldAttributes[$key]);
248
+        }
247 249
 
248 250
         // If no difference then get out of here
249 251
         if (count(array_diff_assoc($newAttributes, $oldAttributes)) <= 0) {
Please login to merge, or discard this patch.
src/components/Helper.php 1 patch
Braces   +53 added lines, -35 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public static function serialize($data, $compact = true)
25 25
     {
26
-        if ($compact)
27
-            $data = self::compact($data);
26
+        if ($compact) {
27
+                    $data = self::compact($data);
28
+        }
28 29
 
29 30
         $data = serialize($data);
30 31
         $data = self::compress($data);
@@ -39,19 +40,22 @@  discard block
 block discarded – undo
39 40
      */
40 41
     public static function unserialize($data)
41 42
     {
42
-        if (is_resource($data))
43
-            // For some databases (like Postgres) binary columns return as a resource, fetch the content first
43
+        if (is_resource($data)) {
44
+                    // For some databases (like Postgres) binary columns return as a resource, fetch the content first
44 45
             $data = stream_get_contents($data, -1, 0);
46
+        }
45 47
 
46 48
         $originalData = $data;
47 49
         $data = self::uncompress($data);
48 50
 
49
-        if ($data === false)
50
-            $data = $originalData;
51
+        if ($data === false) {
52
+                    $data = $originalData;
53
+        }
51 54
 
52 55
         $data = @unserialize($data);
53
-        if ($data === false)
54
-            $data = $originalData;
56
+        if ($data === false) {
57
+                    $data = $originalData;
58
+        }
55 59
 
56 60
         return $data;
57 61
     }
@@ -63,8 +67,9 @@  discard block
 block discarded – undo
63 67
      */
64 68
     public static function compress($data)
65 69
     {
66
-        if (Audit::getInstance()->compressData)
67
-            $data = gzcompress($data);
70
+        if (Audit::getInstance()->compressData) {
71
+                    $data = gzcompress($data);
72
+        }
68 73
         return $data;
69 74
     }
70 75
 
@@ -90,15 +95,17 @@  discard block
 block discarded – undo
90 95
     public static function compact($data, $simplify = false, $threshold = 512)
91 96
     {
92 97
         $data = ArrayHelper::toArray($data);
93
-        if ($simplify)
94
-            array_walk($data, function (&$value) {
98
+        if ($simplify) {
99
+                    array_walk($data, function (&$value) {
95 100
                 if (is_array($value) && count($value) == 1) $value = reset($value);
101
+        }
96 102
             });
97 103
 
98 104
         $tooBig = [];
99
-        foreach ($data as $index => $value)
100
-            if (strlen(serialize($value)) > $threshold)
105
+        foreach ($data as $index => $value) {
106
+                    if (strlen(serialize($value)) > $threshold)
101 107
                 $tooBig[] = $index;
108
+        }
102 109
 
103 110
         if (count($tooBig)) {
104 111
             $data = array_diff_key($data, array_flip($tooBig));
@@ -117,8 +124,9 @@  discard block
 block discarded – undo
117 124
     {
118 125
         $trace = debug_backtrace();
119 126
         array_pop($trace); // remove the last trace since it would be the entry script, not very useful
120
-        if ($skip > 0)
121
-            $trace = array_slice($trace, $skip);
127
+        if ($skip > 0) {
128
+                    $trace = array_slice($trace, $skip);
129
+        }
122 130
         return self::cleanupTrace($trace);
123 131
     }
124 132
 
@@ -130,8 +138,9 @@  discard block
 block discarded – undo
130 138
      */
131 139
     public static function cleanupTrace($trace)
132 140
     {
133
-        if (!is_array($trace))
134
-            return [];
141
+        if (!is_array($trace)) {
142
+                    return [];
143
+        }
135 144
 
136 145
         foreach ($trace as $n => $call) {
137 146
             $call['file'] = isset($call['file']) ? $call['file'] : 'unknown';
@@ -140,14 +149,18 @@  discard block
 block discarded – undo
140 149
             $call['file'] = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $call['file']);
141 150
 
142 151
             // XDebug
143
-            if (isset($call['params'])) unset($call['params']);
152
+            if (isset($call['params'])) {
153
+                unset($call['params']);
154
+            }
144 155
 
145 156
             // Trace entry contains the class instance, also compact and include this
146
-            if (isset($call['object']))
147
-                $call['object'] = current(self::cleanupTraceArguments([$call['object']]));
157
+            if (isset($call['object'])) {
158
+                            $call['object'] = current(self::cleanupTraceArguments([$call['object']]));
159
+            }
148 160
 
149
-            if (isset($call['args']))
150
-                $call['args'] = self::cleanupTraceArguments($call['args']);
161
+            if (isset($call['args'])) {
162
+                            $call['args'] = self::cleanupTraceArguments($call['args']);
163
+            }
151 164
 
152 165
             $trace[$n] = $call;
153 166
         }
@@ -176,10 +189,11 @@  discard block
 block discarded – undo
176 189
                     $args[$name] = $object;
177 190
                 }
178 191
             } else if (is_array($value)) {
179
-                if ($recurseDepth > 0)
180
-                    $args[$name] = self::cleanupTraceArguments($value, $recurseDepth - 1);
181
-                else
182
-                    $args[$name] = 'Array';
192
+                if ($recurseDepth > 0) {
193
+                                    $args[$name] = self::cleanupTraceArguments($value, $recurseDepth - 1);
194
+                } else {
195
+                                    $args[$name] = 'Array';
196
+                }
183 197
             }
184 198
         }
185 199
         return $args;
@@ -212,8 +226,9 @@  discard block
 block discarded – undo
212 226
     public static function formatAsQuery($data)
213 227
     {
214 228
         $data = rawurldecode($data);
215
-        if (!preg_match('/^([\w\d\-\[\]]+(=[^&]*)?(&[\w\d\-\[\]]+(=[^&]*)?)*)?$/', $data))
216
-            return null;
229
+        if (!preg_match('/^([\w\d\-\[\]]+(=[^&]*)?(&[\w\d\-\[\]]+(=[^&]*)?)*)?$/', $data)) {
230
+                    return null;
231
+        }
217 232
 
218 233
         $result = [];
219 234
         parse_str($data, $result);
@@ -241,8 +256,9 @@  discard block
 block discarded – undo
241 256
         $doc = new \DOMDocument('1.0');
242 257
         $doc->preserveWhiteSpace = false;
243 258
         $doc->formatOutput = true;
244
-        if (@$doc->loadXML($data))
245
-            return htmlentities($doc->saveXML(), ENT_COMPAT, 'UTF-8');
259
+        if (@$doc->loadXML($data)) {
260
+                    return htmlentities($doc->saveXML(), ENT_COMPAT, 'UTF-8');
261
+        }
246 262
         return null;
247 263
     }
248 264
 
@@ -253,14 +269,16 @@  discard block
 block discarded – undo
253 269
      */
254 270
     public static function formatAsHTML($data)
255 271
     {
256
-        if ($data == strip_tags($data) || strtolower(substr(ltrim($data), 0, 5)) == '<?xml')
257
-            return null;
272
+        if ($data == strip_tags($data) || strtolower(substr(ltrim($data), 0, 5)) == '<?xml') {
273
+                    return null;
274
+        }
258 275
 
259 276
         $doc = new \DOMDocument('1.0');
260 277
         $doc->preserveWhiteSpace = false;
261 278
         $doc->formatOutput = true;
262
-        if (@$doc->loadHTML($data))
263
-            return htmlentities($doc->saveHTML(), ENT_COMPAT, 'UTF-8');
279
+        if (@$doc->loadHTML($data)) {
280
+                    return htmlentities($doc->saveHTML(), ENT_COMPAT, 'UTF-8');
281
+        }
264 282
         return null;
265 283
     }
266 284
 }
Please login to merge, or discard this patch.