Passed
Push — 1.10.x ( 57ccd9...af0b2a )
by Angel Fernando Quiroz
93:14 queued 54:02
created
main/inc/lib/pdf.lib.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -536,8 +536,9 @@
 block discarded – undo
536 536
             }
537 537
         } else {
538 538
             $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';   // course path
539
-            if (file_exists($store_path))
540
-                $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
539
+            if (file_exists($store_path)) {
540
+                            $web_path   = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png';
541
+            }
541 542
         }
542 543
         return $web_path;
543 544
     }
Please login to merge, or discard this patch.
main/inc/lib/pear/excelreader/OLERead.inc 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,14 +240,16 @@
 block discarded – undo
240 240
 		    return $streamData;
241 241
     		
242 242
 
243
-    	}else{
243
+    	} else{
244 244
     	
245 245
 	        $numBlocks = $this->props[$this->wrkbook]['size'] / BIG_BLOCK_SIZE;
246 246
 	        if ($this->props[$this->wrkbook]['size'] % BIG_BLOCK_SIZE != 0) {
247 247
 	            $numBlocks++;
248 248
 	        }
249 249
 	        
250
-	        if ($numBlocks == 0) return '';
250
+	        if ($numBlocks == 0) {
251
+	            return '';
252
+	        }
251 253
 	        
252 254
 	        //echo "numBlocks = $numBlocks\n";
253 255
 	    //byte[] streamData = new byte[numBlocks * BIG_BLOCK_SIZE];
Please login to merge, or discard this patch.
main/inc/lib/pear/excelreader/reader.php 1 patch
Braces   +37 added lines, -27 removed lines patch added patch discarded remove patch
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
                                                 if ($spos + $len < $limitpos) {
506 506
                                                                 $retstr = substr($this->data, $spos, $len);
507 507
                                                                 $spos += $len;
508
-                                                }else{
508
+                                                } else{
509 509
                                                         // found countinue
510 510
                                                         $retstr = substr($this->data, $spos, $limitpos - $spos);
511 511
                                                         $bytesRead = $limitpos - $spos;
@@ -527,12 +527,12 @@  discard block
 block discarded – undo
527 527
                                                                     $retstr .= substr($this->data, $spos, $len);
528 528
                                                                     $charsLeft -= $len;
529 529
                                                                     $asciiEncoding = true;
530
-                                                                  }elseif (!$asciiEncoding && ($option != 0)){
530
+                                                                  } elseif (!$asciiEncoding && ($option != 0)){
531 531
                                                                                 $len = min($charsLeft * 2, $limitpos - $spos); // min($charsLeft, $conlength);
532 532
                                                                     $retstr .= substr($this->data, $spos, $len);
533 533
                                                                     $charsLeft -= $len/2;
534 534
                                                                     $asciiEncoding = false;
535
-                                                                  }elseif (!$asciiEncoding && ($option == 0)) {
535
+                                                                  } elseif (!$asciiEncoding && ($option == 0)) {
536 536
                                                                 // Bummer - the string starts off as Unicode, but after the
537 537
                                                                 // continuation it is in straightforward ASCII encoding
538 538
                                                                                 $len = min($charsLeft, $limitpos - $spos); // min($charsLeft, $conlength);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                                                                 }
542 542
                                                             $charsLeft -= $len;
543 543
                                                                 $asciiEncoding = false;
544
-                                                                  }else{
544
+                                                                  } else{
545 545
                                                             $newstr = '';
546 546
                                                                     for ($j = 0; $j < strlen($retstr); $j++) {
547 547
                                                                       $newstr = $retstr[$j].chr(0);
@@ -619,22 +619,24 @@  discard block
 block discarded – undo
619 619
                                     'type' => 'date',
620 620
                                     'format' => $this->dateFormats[$indexCode]
621 621
                                     );
622
-                        }elseif (array_key_exists($indexCode, $this->numberFormats)) {
622
+                        } elseif (array_key_exists($indexCode, $this->numberFormats)) {
623 623
                         //echo "isnumber ".$this->numberFormats[$indexCode];
624 624
                             $this->formatRecords['xfrecords'][] = array(
625 625
                                     'type' => 'number',
626 626
                                     'format' => $this->numberFormats[$indexCode]
627 627
                                     );
628
-                        }else{
628
+                        } else{
629 629
                             $isdate = FALSE;
630 630
                             if ($indexCode > 0){
631
-                                if (isset($this->formatRecords[$indexCode]))
632
-                                    $formatstr = $this->formatRecords[$indexCode];
631
+                                if (isset($this->formatRecords[$indexCode])) {
632
+                                                                    $formatstr = $this->formatRecords[$indexCode];
633
+                                }
633 634
                                 //echo '.other.';
634 635
                                 //echo "\ndate-time=$formatstr=\n";
635
-                                if ($formatstr)
636
-                                if (preg_match("/[^hmsday\/\-:\s]/i", $formatstr) == 0) { // found day and time format
636
+                                if ($formatstr) {
637
+                                                                if (preg_match("/[^hmsday\/\-:\s]/i", $formatstr) == 0) { // found day and time format
637 638
                                     $isdate = TRUE;
639
+                                }
638 640
                                     $formatstr = str_replace('mm', 'i', $formatstr);
639 641
                                     $formatstr = str_replace('h', 'H', $formatstr);
640 642
                                     //echo "\ndate-time $formatstr \n";
@@ -646,7 +648,7 @@  discard block
 block discarded – undo
646 648
                                         'type' => 'date',
647 649
                                         'format' => $formatstr,
648 650
                                         );
649
-                            }else{
651
+                            } else{
650 652
                                 $this->formatRecords['xfrecords'][] = array(
651 653
                                         'type' => 'other',
652 654
                                         'format' => '',
@@ -674,7 +676,7 @@  discard block
 block discarded – undo
674 676
                             } else {
675 677
                                 $rec_name    = $this->_encodeUTF16(substr($this->data, $pos+12, $rec_length*2));
676 678
                             }
677
-                        }elseif ($version == SPREADSHEET_EXCEL_READER_BIFF7){
679
+                        } elseif ($version == SPREADSHEET_EXCEL_READER_BIFF7){
678 680
                                 $rec_name    = substr($this->data, $pos+11, $rec_length);
679 681
                         }
680 682
                     $this->boundsheets[] = array('name'=>$rec_name,
@@ -733,7 +735,9 @@  discard block
 block discarded – undo
733 735
             //echo "mem= ".memory_get_usage()."\n";
734 736
 //            $r = &$this->file->nextRecord();
735 737
             $lowcode = ord($this->data[$spos]);
736
-            if ($lowcode == SPREADSHEET_EXCEL_READER_TYPE_EOF) break;
738
+            if ($lowcode == SPREADSHEET_EXCEL_READER_TYPE_EOF) {
739
+                break;
740
+            }
737 741
             $code = $lowcode | ord($this->data[$spos+1])<<8;
738 742
             $length = ord($this->data[$spos+2]) | ord($this->data[$spos+3])<<8;
739 743
             $spos += 4;
@@ -783,7 +787,7 @@  discard block
 block discarded – undo
783 787
                     //echo $numValue." ";
784 788
                     if ($this->isDate($spos)) {
785 789
                         list($string, $raw) = $this->createDate($numValue);
786
-                    }else{
790
+                    } else{
787 791
                         $raw = $numValue;
788 792
                         if (isset($this->_columnsFormat[$column + 1])){
789 793
                                 $this->curformat = $this->_columnsFormat[$column + 1];
@@ -813,7 +817,7 @@  discard block
 block discarded – undo
813 817
                         $numValue = $this->_GetIEEE754($this->_GetInt4d($this->data, $tmppos + 2));
814 818
                         if ($this->isDate($tmppos-4)) {
815 819
                             list($string, $raw) = $this->createDate($numValue);
816
-                        }else{
820
+                        } else{
817 821
                             $raw = $numValue;
818 822
                             if (isset($this->_columnsFormat[$colFirst + $i + 1])){
819 823
                                         $this->curformat = $this->_columnsFormat[$colFirst + $i + 1];
@@ -837,7 +841,7 @@  discard block
 block discarded – undo
837 841
                     if ($this->isDate($spos)) {
838 842
                         list($string, $raw) = $this->createDate($tmp['double']);
839 843
                      //   $this->addcell(DateRecord($r, 1));
840
-                    }else{
844
+                    } else{
841 845
                         //$raw = $tmp[''];
842 846
                         if (isset($this->_columnsFormat[$column + 1])){
843 847
                                 $this->curformat = $this->_columnsFormat[$column + 1];
@@ -869,7 +873,7 @@  discard block
 block discarded – undo
869 873
                         if ($this->isDate($spos)) {
870 874
                             list($string, $raw) = $this->createDate($tmp['double']);
871 875
                          //   $this->addcell(DateRecord($r, 1));
872
-                        }else{
876
+                        } else{
873 877
                             //$raw = $tmp[''];
874 878
                             if (isset($this->_columnsFormat[$column + 1])){
875 879
                                     $this->curformat = $this->_columnsFormat[$column + 1];
@@ -913,10 +917,12 @@  discard block
 block discarded – undo
913 917
             $spos += $length;
914 918
         }
915 919
 
916
-        if (!isset($this->sheets[$this->sn]['numRows']))
917
-             $this->sheets[$this->sn]['numRows'] = $this->sheets[$this->sn]['maxrow'];
918
-        if (!isset($this->sheets[$this->sn]['numCols']))
919
-             $this->sheets[$this->sn]['numCols'] = $this->sheets[$this->sn]['maxcol'];
920
+        if (!isset($this->sheets[$this->sn]['numRows'])) {
921
+                     $this->sheets[$this->sn]['numRows'] = $this->sheets[$this->sn]['maxrow'];
922
+        }
923
+        if (!isset($this->sheets[$this->sn]['numCols'])) {
924
+                     $this->sheets[$this->sn]['numCols'] = $this->sheets[$this->sn]['maxcol'];
925
+        }
920 926
 
921 927
     }
922 928
 
@@ -943,7 +949,7 @@  discard block
 block discarded – undo
943 949
                 if (($xfindex == 0x9) || ($xfindex == 0xa)){
944 950
                     $this->multiplier = 100;
945 951
                 }
946
-            }else{
952
+            } else{
947 953
                 $this->curformat = $this->_defaultFormat;
948 954
                 $this->rectype = 'unknown';
949 955
             }
@@ -993,7 +999,9 @@  discard block
 block discarded – undo
993 999
         $mantissalow1 = ($rknumlow & 0x80000000) >> 31;
994 1000
         $mantissalow2 = ($rknumlow & 0x7fffffff);
995 1001
         $value = $mantissa / pow( 2 , (20- ($exp - 1023)));
996
-        if ($mantissalow1 != 0) $value += 1 / pow (2 , (21 - ($exp - 1023)));
1002
+        if ($mantissalow1 != 0) {
1003
+            $value += 1 / pow (2 , (21 - ($exp - 1023)));
1004
+        }
997 1005
         $value += $mantissalow2 / pow (2 , (52 - ($exp - 1023)));
998 1006
         //echo "Sign = $sign, Exp = $exp, mantissahighx = $mantissa, mantissalow1 = $mantissalow1, mantissalow2 = $mantissalow2<br>\n";
999 1007
         if ($sign) {$value = -1 * $value;}
@@ -1006,10 +1014,12 @@  discard block
 block discarded – undo
1006 1014
         $this->sheets[$this->sn]['maxrow'] = max($this->sheets[$this->sn]['maxrow'], $row + $this->_rowoffset);
1007 1015
         $this->sheets[$this->sn]['maxcol'] = max($this->sheets[$this->sn]['maxcol'], $col + $this->_coloffset);
1008 1016
         $this->sheets[$this->sn]['cells'][$row + $this->_rowoffset][$col + $this->_coloffset] = $string;
1009
-        if ($raw)
1010
-            $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['raw'] = $raw;
1011
-        if (isset($this->rectype))
1012
-            $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['type'] = $this->rectype;
1017
+        if ($raw) {
1018
+                    $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['raw'] = $raw;
1019
+        }
1020
+        if (isset($this->rectype)) {
1021
+                    $this->sheets[$this->sn]['cellsInfo'][$row + $this->_rowoffset][$col + $this->_coloffset]['type'] = $this->rectype;
1022
+        }
1013 1023
 
1014 1024
     }
1015 1025
 
Please login to merge, or discard this patch.
main/inc/lib/pear/Exception.php 1 patch
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -347,15 +347,22 @@
 block discarded – undo
347 347
             $args = array();
348 348
             if (!empty($v['args'])) {
349 349
                 foreach ($v['args'] as $arg) {
350
-                    if (is_null($arg)) $args[] = 'null';
351
-                    elseif (is_array($arg)) $args[] = 'Array';
352
-                    elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
353
-                    elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
354
-                    elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
355
-                    else {
350
+                    if (is_null($arg)) {
351
+                        $args[] = 'null';
352
+                    } elseif (is_array($arg)) {
353
+                        $args[] = 'Array';
354
+                    } elseif (is_object($arg)) {
355
+                        $args[] = 'Object('.get_class($arg).')';
356
+                    } elseif (is_bool($arg)) {
357
+                        $args[] = $arg ? 'true' : 'false';
358
+                    } elseif (is_int($arg) || is_double($arg)) {
359
+                        $args[] = $arg;
360
+                    } else {
356 361
                         $arg = (string)$arg;
357 362
                         $str = htmlspecialchars(substr($arg, 0, 16));
358
-                        if (strlen($arg) > 16) $str .= '&hellip;';
363
+                        if (strlen($arg) > 16) {
364
+                            $str .= '&hellip;';
365
+                        }
359 366
                         $args[] = "'" . $str . "'";
360 367
                     }
361 368
                 }
Please login to merge, or discard this patch.
main/inc/lib/dashboard.lib.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -380,7 +380,9 @@
 block discarded – undo
380 380
 					// check if user is allowed to see the block
381 381
 					if (method_exists($obj_block, 'is_block_visible_for_user')) {
382 382
 						$is_block_visible_for_user = $obj_block->is_block_visible_for_user($user_id);
383
-						if (!$is_block_visible_for_user) continue;
383
+						if (!$is_block_visible_for_user) {
384
+						    continue;
385
+						}
384 386
 					}
385 387
 
386 388
 					echo '<tr>';
Please login to merge, or discard this patch.
main/inc/lib/myspace.lib.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2097,7 +2097,9 @@
 block discarded – undo
2097 2097
                 FROM $tbl_course course
2098 2098
                 WHERE course.code IN (".implode(',',$courses_code).")";
2099 2099
 
2100
-        if (!in_array($direction, array('ASC','DESC'))) $direction = 'ASC';
2100
+        if (!in_array($direction, array('ASC','DESC'))) {
2101
+            $direction = 'ASC';
2102
+        }
2101 2103
 
2102 2104
         $column = intval($column);
2103 2105
         $from = intval($from);
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.soapclient.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -173,8 +173,9 @@  discard block
 block discarded – undo
173 173
 		}
174 174
 		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
175 175
 			$this->loadWSDL();
176
-			if ($this->getError())
177
-				return false;
176
+			if ($this->getError()) {
177
+							return false;
178
+			}
178 179
 		}
179 180
 		// serialize parameters
180 181
 		if($this->endpointType == 'wsdl' && $opData = $this->getOperationData($operation)){
@@ -388,8 +389,9 @@  discard block
 block discarded – undo
388 389
 	function getOperationData($operation){
389 390
 		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
390 391
 			$this->loadWSDL();
391
-			if ($this->getError())
392
-				return false;
392
+			if ($this->getError()) {
393
+							return false;
394
+			}
393 395
 		}
394 396
 		if(isset($this->operations[$operation])){
395 397
 			return $this->operations[$operation];
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.soap_transport_http.php 1 patch
Braces   +39 added lines, -29 removed lines patch added patch discarded remove patch
@@ -159,10 +159,12 @@  discard block
 block discarded – undo
159 159
 	* @access	private
160 160
 	*/
161 161
 	function io_method() {
162
-		if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm'))
163
-			return 'curl';
164
-		if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm'))
165
-			return 'socket';
162
+		if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm')) {
163
+					return 'curl';
164
+		}
165
+		if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm')) {
166
+					return 'socket';
167
+		}
166 168
 		return 'unknown';
167 169
 	}
168 170
 
@@ -246,30 +248,36 @@  discard block
 block discarded – undo
246 248
 			return false;
247 249
 		}
248 250
 		// Avoid warnings when PHP does not have these options
249
-		if (defined('CURLOPT_CONNECTIONTIMEOUT'))
250
-			$CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
251
-		else
252
-			$CURLOPT_CONNECTIONTIMEOUT = 78;
253
-		if (defined('CURLOPT_HTTPAUTH'))
254
-			$CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
255
-		else
256
-			$CURLOPT_HTTPAUTH = 107;
257
-		if (defined('CURLOPT_PROXYAUTH'))
258
-			$CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
259
-		else
260
-			$CURLOPT_PROXYAUTH = 111;
261
-		if (defined('CURLAUTH_BASIC'))
262
-			$CURLAUTH_BASIC = CURLAUTH_BASIC;
263
-		else
264
-			$CURLAUTH_BASIC = 1;
265
-		if (defined('CURLAUTH_DIGEST'))
266
-			$CURLAUTH_DIGEST = CURLAUTH_DIGEST;
267
-		else
268
-			$CURLAUTH_DIGEST = 2;
269
-		if (defined('CURLAUTH_NTLM'))
270
-			$CURLAUTH_NTLM = CURLAUTH_NTLM;
271
-		else
272
-			$CURLAUTH_NTLM = 8;
251
+		if (defined('CURLOPT_CONNECTIONTIMEOUT')) {
252
+					$CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
253
+		} else {
254
+					$CURLOPT_CONNECTIONTIMEOUT = 78;
255
+		}
256
+		if (defined('CURLOPT_HTTPAUTH')) {
257
+					$CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
258
+		} else {
259
+					$CURLOPT_HTTPAUTH = 107;
260
+		}
261
+		if (defined('CURLOPT_PROXYAUTH')) {
262
+					$CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
263
+		} else {
264
+					$CURLOPT_PROXYAUTH = 111;
265
+		}
266
+		if (defined('CURLAUTH_BASIC')) {
267
+					$CURLAUTH_BASIC = CURLAUTH_BASIC;
268
+		} else {
269
+					$CURLAUTH_BASIC = 1;
270
+		}
271
+		if (defined('CURLAUTH_DIGEST')) {
272
+					$CURLAUTH_DIGEST = CURLAUTH_DIGEST;
273
+		} else {
274
+					$CURLAUTH_DIGEST = 2;
275
+		}
276
+		if (defined('CURLAUTH_NTLM')) {
277
+					$CURLAUTH_NTLM = CURLAUTH_NTLM;
278
+		} else {
279
+					$CURLAUTH_NTLM = 8;
280
+		}
273 281
 
274 282
 		$this->debug('connect using cURL');
275 283
 		// init CURL
@@ -612,7 +620,9 @@  discard block
 block discarded – undo
612 620
 								'HTTP/1.0 200 Connection established');
613 621
 		foreach ($skipHeaders as $hd) {
614 622
 			$prefix = substr($data, 0, strlen($hd));
615
-			if ($prefix == $hd) return true;
623
+			if ($prefix == $hd) {
624
+			    return true;
625
+			}
616 626
 		}
617 627
 
618 628
 		return false;
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.wsdl.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,8 +78,9 @@
 block discarded – undo
78 78
 		$this->proxypassword = $proxypassword;
79 79
 		$this->timeout = $timeout;
80 80
 		$this->response_timeout = $response_timeout;
81
-		if (is_array($curl_options))
82
-			$this->curl_options = $curl_options;
81
+		if (is_array($curl_options)) {
82
+					$this->curl_options = $curl_options;
83
+		}
83 84
 		$this->use_curl = $use_curl;
84 85
 		$this->fetchWSDL($wsdl);
85 86
     }
Please login to merge, or discard this patch.