Passed
Push — 1.10.x ( aa45ad...6deddd )
by Yannick
44:37
created
main/inc/lib/phpseclib/File/X509.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1711,8 +1711,7 @@  discard block
 block discarded – undo
1711 1711
                 if ($map === false) {
1712 1712
                     user_error($id . ' is not a currently supported attribute', E_USER_NOTICE);
1713 1713
                     unset($attributes[$i]);
1714
-                }
1715
-                elseif (is_array($attributes[$i]['value'])) {
1714
+                } elseif (is_array($attributes[$i]['value'])) {
1716 1715
                     $values = &$attributes[$i]['value'];
1717 1716
                     for ($j = 0; $j < count($values); $j++) {
1718 1717
                         switch ($id) {
@@ -3345,8 +3344,7 @@  discard block
 block discarded – undo
3345 3344
 
3346 3345
         if (!empty($this->serialNumber)) {
3347 3346
             $crlNumber = $this->serialNumber;
3348
-        }
3349
-        else {
3347
+        } else {
3350 3348
             $crlNumber = $this->getExtension('id-ce-cRLNumber');
3351 3349
             $crlNumber = $crlNumber !== false ? $crlNumber->add(new Math_BigInteger(1)) : NULL;
3352 3350
         }
@@ -3359,8 +3357,7 @@  discard block
 block discarded – undo
3359 3357
         if (!$version) {
3360 3358
             if (!empty($tbsCertList['crlExtensions'])) {
3361 3359
                 $version = 1; // v2.
3362
-            }
3363
-            elseif (!empty($tbsCertList['revokedCertificates'])) {
3360
+            } elseif (!empty($tbsCertList['revokedCertificates'])) {
3364 3361
                 foreach ($tbsCertList['revokedCertificates'] as $cert) {
3365 3362
                     if (!empty($cert['crlEntryExtensions'])) {
3366 3363
                         $version = 1; // v2.
Please login to merge, or discard this patch.
main/inc/lib/phpseclib/File/ANSI.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -350,10 +350,18 @@
 block discarded – undo
350 350
                                         case 0: // Turn off character attributes
351 351
                                             $this->attrs[$this->y][$this->x] = '';
352 352
 
353
-                                            if ($this->bold) $this->attrs[$this->y][$this->x].= '</b>';
354
-                                            if ($this->underline) $this->attrs[$this->y][$this->x].= '</underline>';
355
-                                            if ($this->blink) $this->attrs[$this->y][$this->x].= '</blink>';
356
-                                            if ($this->color) $this->attrs[$this->y][$this->x].= '</span>';
353
+                                            if ($this->bold) {
354
+                                                $this->attrs[$this->y][$this->x].= '</b>';
355
+                                            }
356
+                                            if ($this->underline) {
357
+                                                $this->attrs[$this->y][$this->x].= '</underline>';
358
+                                            }
359
+                                            if ($this->blink) {
360
+                                                $this->attrs[$this->y][$this->x].= '</blink>';
361
+                                            }
362
+                                            if ($this->color) {
363
+                                                $this->attrs[$this->y][$this->x].= '</span>';
364
+                                            }
357 365
 
358 366
                                             if ($this->reverse) {
359 367
                                                 $temp = $this->background;
Please login to merge, or discard this patch.
main/inc/lib/phpseclib/File/ASN1.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -586,8 +586,7 @@  discard block
 block discarded – undo
586 586
                             if (isset($child['class'])) {
587 587
                                 $childClass = $child['class'];
588 588
                                 $constant = $child['cast'];
589
-                            }
590
-                            elseif (isset($child['constant'])) {
589
+                            } elseif (isset($child['constant'])) {
591 590
                                 $childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
592 591
                                 $constant = $child['constant'];
593 592
                             }
@@ -656,8 +655,7 @@  discard block
 block discarded – undo
656 655
                             if (isset($child['class'])) {
657 656
                                 $childClass = $child['class'];
658 657
                                 $constant = $child['cast'];
659
-                            }
660
-                            elseif (isset($child['constant'])) {
658
+                            } elseif (isset($child['constant'])) {
661 659
                                 $childClass = FILE_ASN1_CLASS_CONTEXT_SPECIFIC;
662 660
                                 $constant = $child['constant'];
663 661
                             }
Please login to merge, or discard this patch.
main/inc/lib/sortable_table.class.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -808,8 +808,9 @@
 block discarded – undo
808 808
             foreach ($param as $key => & $value) {
809 809
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
810 810
             }
811
-            if (count($param_string_parts) > 0)
812
-                $result .= '&amp;'.implode('&amp;', $param_string_parts);
811
+            if (count($param_string_parts) > 0) {
812
+                            $result .= '&amp;'.implode('&amp;', $param_string_parts);
813
+            }
813 814
         }
814 815
         return $result;
815 816
     }
Please login to merge, or discard this patch.
main/inc/lib/api.lib.php 1 patch
Braces   +25 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1819,7 +1819,9 @@  discard block
 block discarded – undo
1819 1819
     }
1820 1820
 
1821 1821
     global $_course;
1822
-    if ($_course == '-1') $_course = array();
1822
+    if ($_course == '-1') {
1823
+        $_course = array();
1824
+    }
1823 1825
     return $_course;
1824 1826
 }
1825 1827
 
@@ -4315,17 +4317,20 @@  discard block
 block discarded – undo
4315 4317
     switch ($lang_type) {
4316 4318
         case 'platform_lang':
4317 4319
             $temp_lang = api_get_setting('platformLanguage');
4318
-            if (!empty($temp_lang))
4319
-                $return = $temp_lang;
4320
+            if (!empty($temp_lang)) {
4321
+                            $return = $temp_lang;
4322
+            }
4320 4323
             break;
4321 4324
         case 'user_profil_lang':
4322 4325
             $_user = api_get_user_info();
4323
-            if (isset($_user['language']) && !empty($_user['language']))
4324
-                $return = $_user['language'];
4326
+            if (isset($_user['language']) && !empty($_user['language'])) {
4327
+                            $return = $_user['language'];
4328
+            }
4325 4329
             break;
4326 4330
         case 'user_selected_lang':
4327
-            if (isset($_SESSION['user_language_choice']) && !empty($_SESSION['user_language_choice']))
4328
-                $return = $_SESSION['user_language_choice'];
4331
+            if (isset($_SESSION['user_language_choice']) && !empty($_SESSION['user_language_choice'])) {
4332
+                            $return = $_SESSION['user_language_choice'];
4333
+            }
4329 4334
             break;
4330 4335
         case 'course_lang':
4331 4336
             global $_course;
@@ -4343,8 +4348,9 @@  discard block
 block discarded – undo
4343 4348
                 }
4344 4349
             }
4345 4350
             $_course = api_get_course_info($cidReq);
4346
-            if (isset($_course['language']) && !empty($_course['language']))
4347
-                $return = $_course['language'];
4351
+            if (isset($_course['language']) && !empty($_course['language'])) {
4352
+                            $return = $_course['language'];
4353
+            }
4348 4354
             break;
4349 4355
         default:
4350 4356
             $return = false;
@@ -5604,8 +5610,7 @@  discard block
 block discarded – undo
5604 5610
             $is_courseAdmin = false;
5605 5611
             $is_courseCoach = true;
5606 5612
             $is_sessionAdmin = false;
5607
-        }
5608
-        elseif ($row[0]['session_admin_id'] == $userid) {
5613
+        } elseif ($row[0]['session_admin_id'] == $userid) {
5609 5614
             $is_courseMember = false;
5610 5615
             $is_courseTutor = false;
5611 5616
             $is_courseAdmin = false;
@@ -5885,7 +5890,9 @@  discard block
 block discarded – undo
5885 5890
 
5886 5891
     if (!empty($course_code)) {
5887 5892
         if (isset($_SESSION['_course']['sysCode'])) {
5888
-            if ($course_code != $_SESSION['_course']['sysCode']) return false;
5893
+            if ($course_code != $_SESSION['_course']['sysCode']) {
5894
+                return false;
5895
+            }
5889 5896
         } else {
5890 5897
             return false;
5891 5898
         }
@@ -5942,8 +5949,7 @@  discard block
 block discarded – undo
5942 5949
     elseif (isset($_ENV['OS'])) {
5943 5950
         // Sometimes $_ENV['OS'] may not be present (bugs?)
5944 5951
         $os = $_ENV['OS'];
5945
-    }
5946
-    elseif (defined('PHP_OS')) {
5952
+    } elseif (defined('PHP_OS')) {
5947 5953
         // PHP_OS means on which OS PHP was compiled, this is why
5948 5954
         // using PHP_OS is the last choice for detection.
5949 5955
         $os = PHP_OS;
@@ -6007,12 +6013,10 @@  discard block
 block discarded – undo
6007 6013
     if ($delta_width > $delta_height) {
6008 6014
         $result['width'] = ceil($image_width * $resize_factor_height);
6009 6015
         $result['height'] = ceil($image_height * $resize_factor_height);
6010
-    }
6011
-    elseif ($delta_width < $delta_height) {
6016
+    } elseif ($delta_width < $delta_height) {
6012 6017
         $result['width'] = ceil($image_width * $resize_factor_width);
6013 6018
         $result['height'] = ceil($image_height * $resize_factor_width);
6014
-    }
6015
-    else {
6019
+    } else {
6016 6020
         $result['width'] = ceil($target_width);
6017 6021
         $result['height'] = ceil($target_height);
6018 6022
     }
@@ -6781,7 +6785,9 @@  discard block
 block discarded – undo
6781 6785
         }
6782 6786
         $ip = trim($ip1);
6783 6787
     }
6784
-    if (!empty($debug)) error_log('Real IP: '.$ip);
6788
+    if (!empty($debug)) {
6789
+        error_log('Real IP: '.$ip);
6790
+    }
6785 6791
     return $ip;
6786 6792
 }
6787 6793
 
Please login to merge, or discard this patch.
main/inc/lib/online.inc.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -389,7 +389,9 @@
 block discarded – undo
389 389
 */
390 390
 function who_is_online_in_this_course($from, $number_of_items, $uid, $time_limit, $course_code)
391 391
 {
392
-	if (empty($course_code)) return false;
392
+	if (empty($course_code)) {
393
+	    return false;
394
+	}
393 395
 
394 396
     if (empty($time_limit)) {
395 397
         $time_limit = api_get_setting('time_limit_whosonline');
Please login to merge, or discard this patch.
main/inc/lib/fileManage.lib.php 1 patch
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
             Database::query($query);
34 34
             break;
35 35
         case 'update':
36
-            if ($new_path[0] == '.') $new_path = substr($new_path, 1);
36
+            if ($new_path[0] == '.') {
37
+                $new_path = substr($new_path, 1);
38
+            }
37 39
             $new_path = str_replace('//', '/', $new_path);
38 40
 
39 41
             // Attempt to update	- tested & working for root	dir
@@ -379,7 +381,9 @@  discard block
 block discarded – undo
379 381
 			chdir($path);
380 382
 			$handle = opendir($path);
381 383
 			while ($element = readdir($handle)) {
382
-				if ($element == '.' || $element == '..') continue;
384
+				if ($element == '.' || $element == '..') {
385
+				    continue;
386
+				}
383 387
                 // Skip the current and parent directories
384 388
 				if (is_dir($element)) {
385 389
 					$dir_array[] = $path.'/'.$element;
@@ -419,7 +423,9 @@  discard block
 block discarded – undo
419 423
 				chdir($directory);
420 424
 				$handle = opendir($directory);
421 425
 			   	while ($element = readdir($handle)) {
422
-					if ($element == '.' || $element == '..' || $element == '.htaccess') continue;
426
+					if ($element == '.' || $element == '..' || $element == '.htaccess') {
427
+					    continue;
428
+					}
423 429
                     // Skip the current and parent directories
424 430
 					if (!is_dir($element)) {
425 431
 						$element_array[] = $directory.'/'.$element;
@@ -469,7 +475,9 @@  discard block
 block discarded – undo
469 475
 	 */
470 476
 	function set_default_settings($upload_path, $filename, $filetype = 'file', $glued_table, $default_visibility = 'v')
471 477
     {
472
-		if (!$default_visibility) $default_visibility = 'v';
478
+		if (!$default_visibility) {
479
+		    $default_visibility = 'v';
480
+		}
473 481
 
474 482
 		// Make sure path is not wrongly formed
475 483
 		$upload_path = !empty($upload_path) ? "/$upload_path" : '';
Please login to merge, or discard this patch.
main/inc/lib/getid3/getid3.php 1 patch
Braces   +8 added lines, -17 removed lines patch added patch discarded remove patch
@@ -198,8 +198,7 @@  discard block
 block discarded – undo
198 198
                     $tag_class = 'getid3_' . $tag_name;
199 199
                     $tag = new $tag_class($this);
200 200
                     $tag->Analyze();
201
-                }
202
-                catch (getid3_exception $e) {
201
+                } catch (getid3_exception $e) {
203 202
                     throw $e;
204 203
                 }
205 204
             }
@@ -243,9 +242,7 @@  discard block
 block discarded – undo
243 242
             // use assume format on these if format detection failed
244 243
             if (preg_match('/\.mp[123a]$/i', $filename)) {
245 244
                 $determined_format = $file_format_array['mp3'];
246
-            }
247
-
248
-            else {
245
+            } else {
249 246
                 fclose($this->fp);
250 247
                 throw new getid3_exception('Unable to determine file format');
251 248
             }
@@ -259,8 +256,7 @@  discard block
 block discarded – undo
259 256
             if ($determined_format['fail_id3'] === 'ERROR') {
260 257
                 fclose($this->fp);
261 258
                 throw new getid3_exception('ID3 tags not allowed on this file type.');
262
-            }
263
-            elseif ($determined_format['fail_id3'] === 'WARNING') {
259
+            } elseif ($determined_format['fail_id3'] === 'WARNING') {
264 260
                 @$this->info['id3v1'] and $this->warning('ID3v1 tags not allowed on this file type.');
265 261
                 @$this->info['id3v2'] and $this->warning('ID3v2 tags not allowed on this file type.');
266 262
             }
@@ -301,11 +297,9 @@  discard block
 block discarded – undo
301 297
 
302 298
         try {
303 299
              $this->option_analyze and $class->Analyze();
304
-            }
305
-        catch (getid3_exception $e) {
300
+            } catch (getid3_exception $e) {
306 301
             throw $e;
307
-        }
308
-        catch (Exception $e) {
302
+        } catch (Exception $e) {
309 303
             throw new getid3_exception('Corrupt file.');
310 304
         }
311 305
 
@@ -460,8 +454,7 @@  discard block
 block discarded – undo
460 454
 
461 455
         if (is_array($message)) {
462 456
             $this->warnings = array_merge($this->warnings, $message);
463
-        }
464
-        else {
457
+        } else {
465 458
             $this->warnings[] = $message;
466 459
         }
467 460
     }
@@ -1101,8 +1094,7 @@  discard block
 block discarded – undo
1101 1094
                             if (empty($this->info['comments'][$tag_name])) {
1102 1095
 
1103 1096
                                 // fall through and append value
1104
-                            }
1105
-                            elseif ($tag_type == 'id3v1') {
1097
+                            } elseif ($tag_type == 'id3v1') {
1106 1098
 
1107 1099
                                 $new_value_length = strlen(trim($value));
1108 1100
                                 foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) {
@@ -1112,8 +1104,7 @@  discard block
 block discarded – undo
1112 1104
                                         break 2;
1113 1105
                                     }
1114 1106
                                 }
1115
-                            }
1116
-                            else {
1107
+                            } else {
1117 1108
 
1118 1109
                                 $new_value_length = strlen(trim($value));
1119 1110
                                 foreach ($this->info['comments'][$tag_name] as $existing_key => $existing_value) {
Please login to merge, or discard this patch.
main/inc/lib/sessionmanager.lib.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1588,8 +1588,10 @@  discard block
 block discarded – undo
1588 1588
         if (empty($session_visibility)) {
1589 1589
             $session_visibility = $session->getVisibility();
1590 1590
             //default status loaded if empty
1591
-            if (empty($session_visibility))
1592
-                $session_visibility = SESSION_VISIBLE_READ_ONLY; // by default readonly 1
1591
+            if (empty($session_visibility)) {
1592
+                            $session_visibility = SESSION_VISIBLE_READ_ONLY;
1593
+            }
1594
+            // by default readonly 1
1593 1595
         } else {
1594 1596
             if (!in_array($session_visibility, array(SESSION_VISIBLE_READ_ONLY, SESSION_VISIBLE, SESSION_INVISIBLE))) {
1595 1597
                 $session_visibility = SESSION_VISIBLE_READ_ONLY;
@@ -2792,10 +2794,11 @@  discard block
 block discarded – undo
2792 2794
                                 c_id = $courseId AND
2793 2795
                                 user_id = $user_id ";
2794 2796
                     $result = Database::query($sql);
2795
-                    if (Database::affected_rows($result) > 0)
2796
-                        return true;
2797
-                    else
2798
-                        return false;
2797
+                    if (Database::affected_rows($result) > 0) {
2798
+                                            return true;
2799
+                    } else {
2800
+                                            return false;
2801
+                    }
2799 2802
                 } else {
2800 2803
                     // The user is not subscribed to the session, so make sure
2801 2804
                     // he isn't subscribed to a course in this session either
@@ -2806,10 +2809,11 @@  discard block
 block discarded – undo
2806 2809
                                 c_id = $courseId AND
2807 2810
                                 user_id = $user_id ";
2808 2811
                     $result = Database::query($sql);
2809
-                    if (Database::affected_rows($result) > 0)
2810
-                        return true;
2811
-                    else
2812
-                        return false;
2812
+                    if (Database::affected_rows($result) > 0) {
2813
+                                            return true;
2814
+                    } else {
2815
+                                            return false;
2816
+                    }
2813 2817
                 }
2814 2818
             } else {
2815 2819
                 // Assign user as a coach to course
Please login to merge, or discard this patch.