Completed
Push — developer ( a73d1e...07972d )
by Błażej
180:52 queued 129:18
created
libraries/freetag/freetag.class.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @access private
66 66
 	 * @param string Whether to prevent multiple vtiger_users from tagging the same object. By default, set to block (ala Upcoming.org)
67 67
 	 */
68
-	public $_block_multiuser_tag_on_object =0;
68
+	public $_block_multiuser_tag_on_object = 0;
69 69
 
70 70
 	/**
71 71
 	 * @access private
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 * @return An array of Object ID numbers that reference your original objects.
152 152
 	 */ 
153 153
 	public function get_objects_with_tag($tag, $offset = 0, $limit = 100, $tagger_id = NULL) {
154
-		if(!isset($tag)) {
154
+		if (!isset($tag)) {
155 155
 			return false;
156 156
 		}		
157 157
 		$adb = PearDatabase::getInstance();
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 		$where = "tag = ? ";
160 160
 		$params = array($tag);
161 161
 
162
-		if(isset($tagger_id) && ($tagger_id > 0)) {
162
+		if (isset($tagger_id) && ($tagger_id > 0)) {
163 163
 			$where .= "AND tagger_id = ? ";
164 164
 			array_push($params, $tagger_id);
165 165
 		} 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @return An array of Object ID numbers that reference your original objects.
198 198
 	 */ 
199 199
 	public function get_objects_with_tag_all($tag, $tagger_id = NULL) {
200
-		if(!isset($tag)) {
200
+		if (!isset($tag)) {
201 201
 			return false;
202 202
 		}		
203 203
 		$adb = PearDatabase::getInstance();
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 		$where = "tag = ? ";
206 206
 		$params = array($tag);
207 207
 
208
-		if(isset($tagger_id) && ($tagger_id > 0)) {
208
+		if (isset($tagger_id) && ($tagger_id > 0)) {
209 209
 			$where .= "AND tagger_id = ? ";
210 210
 			array_push($params, $tagger_id);
211 211
 		} 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			return $retarr;
250 250
 		}
251 251
 		$params = array($tagArray);
252
-		if(isset($tagger_id) && ($tagger_id > 0)) {
252
+		if (isset($tagger_id) && ($tagger_id > 0)) {
253 253
 			$tagger_sql = "AND tagger_id = ?";
254 254
 			array_push($params, $tagger_id);
255 255
 		} else {
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 		$sql = "SELECT ${prefix}freetagged_objects.object_id, tag, COUNT(DISTINCT tag) AS uniques
271 271
 			FROM ${prefix}freetagged_objects 
272 272
 			INNER JOIN ${prefix}freetags ON (${prefix}freetagged_objects.tag_id = ${prefix}freetags.id)
273
-			WHERE ${prefix}freetags.tag IN (". generateQuestionMarks($tagArray) .")
273
+			WHERE ${prefix}freetags.tag IN (" . generateQuestionMarks($tagArray) . ")
274 274
 			$tagger_sql
275 275
 			GROUP BY ${prefix}freetagged_objects.object_id
276 276
 			HAVING uniques = $numTags
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	 * @return An array of Object ID numbers that reference your original objects.
301 301
 	 */ 
302 302
 	public function get_objects_with_tag_id($tag_id, $offset = 0, $limit = 100, $tagger_id = NULL) {
303
-		if(!isset($tag_id)) {
303
+		if (!isset($tag_id)) {
304 304
 			return false;
305 305
 		}		
306 306
 		$adb = PearDatabase::getInstance();
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		$where = "id = ? ";
309 309
 		$params = array($tag_id);
310 310
 		
311
-		if(isset($tagger_id) && ($tagger_id > 0)) {
311
+		if (isset($tagger_id) && ($tagger_id > 0)) {
312 312
 			$where .= "AND tagger_id = ?";
313 313
 			array_push($params, $tagger_id);
314 314
 		} 
@@ -349,19 +349,19 @@  discard block
 block discarded – undo
349 349
 	 *	 - 'tagger_id' => The unique ID of the person who tagged the object with this tag.
350 350
 	 */ 
351 351
 	public function get_tags_on_object($object_id, $offset = 0, $limit = 10, $tagger_id = NULL) {
352
-		if(!isset($object_id)) {
352
+		if (!isset($object_id)) {
353 353
 			return false;
354 354
 		}	
355 355
 		
356 356
 		$where = "object_id = ? ";
357 357
 		$params = array($object_id);
358 358
 			
359
-		if(isset($tagger_id) && ($tagger_id > 0)) {
359
+		if (isset($tagger_id) && ($tagger_id > 0)) {
360 360
 			$where .= "AND tagger_id = ? ";
361 361
 			array_push($params, $tagger_id);
362 362
 		} 
363 363
 
364
-		if($limit <= 0) {
364
+		if ($limit <= 0) {
365 365
 			$limit_sql = "";
366 366
 		} else {
367 367
 			$limit_sql = "LIMIT $offset, $limit";
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 */ 
407 407
 
408 408
 	public function safe_tag($tagger_id, $object_id, $tag, $module) {
409
-		if(!isset($tagger_id)||!isset($object_id)||!isset($tag)) {
409
+		if (!isset($tagger_id) || !isset($object_id) || !isset($tag)) {
410 410
 			die("safe_tag argument missing");
411 411
 			return false;
412 412
 		}
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 			
434 434
 		array_push($params, $object_id, $normalized_tag);
435 435
 		$rs = $adb->pquery($sql, $params);
436
-		if($rs->fields['count'] > 0) {
436
+		if ($rs->fields['count'] > 0) {
437 437
 			return true;
438 438
 		}
439 439
 		// Then see if a raw tag in this form exists.
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 			WHERE raw_tag = ? ";
443 443
 		$rs = $adb->pquery($sql, array($tag));
444 444
 		$row = $adb->fetch_array($rs);
445
-		if($row) {
445
+		if ($row) {
446 446
 			$tag_id = $row['id'];
447 447
 		} else {
448 448
 			// Add new tag! 
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 			$rs = $adb->pquery($sql, $params);
453 453
 			
454 454
 		}
455
-		if(!($tag_id > 0)) {
455
+		if (!($tag_id > 0)) {
456 456
 			return false;
457 457
 		}
458 458
 		$sql = "INSERT INTO ${prefix}freetagged_objects
@@ -509,14 +509,14 @@  discard block
 block discarded – undo
509 509
 	 * @return string Returns the tag in normalized form.
510 510
 	 */ 
511 511
 	public function delete_object_tag($tagger_id, $object_id, $tag) {
512
-		if(!isset($tagger_id)||!isset($object_id)||!isset($tag)) {
512
+		if (!isset($tagger_id) || !isset($object_id) || !isset($tag)) {
513 513
 			die("delete_object_tag argument missing");
514 514
 			return false;
515 515
 		}
516 516
 		$adb = PearDatabase::getInstance();
517 517
 		$tag_id = $this->get_raw_tag_id($tag);
518 518
 		$prefix = $this->_table_prefix;
519
-		if($tag_id > 0) {
519
+		if ($tag_id > 0) {
520 520
 
521 521
 			$sql = "DELETE FROM ${prefix}freetagged_objects
522 522
 				WHERE tagger_id = ? && object_id = ? && tag_id = ? LIMIT 1";
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	public function delete_all_object_tags($object_id) {
544 544
 		$adb = PearDatabase::getInstance();
545 545
 		$prefix = $this->_table_prefix;
546
-		if($object_id > 0) {
546
+		if ($object_id > 0) {
547 547
 			$sql = "DELETE FROM ${prefix}freetagged_objects
548 548
 				WHERE object_id = ? ";	
549 549
 				$rs = $adb->pquery($sql, array($object_id));	
@@ -570,13 +570,13 @@  discard block
 block discarded – undo
570 570
 	 */ 
571 571
 
572 572
 	public function delete_all_object_tags_for_user($tagger_id, $object_id) {
573
-		if(!isset($tagger_id)||!isset($object_id)) {
573
+		if (!isset($tagger_id) || !isset($object_id)) {
574 574
 			die("delete_all_object_tags_for_user argument missing");
575 575
 			return false;
576 576
 		}
577 577
 		$adb = PearDatabase::getInstance();
578 578
 		$prefix = $this->_table_prefix;
579
-		if($object_id > 0) {
579
+		if ($object_id > 0) {
580 580
 
581 581
 			$sql = "DELETE FROM ${prefix}freetagged_objects
582 582
 				WHERE tagger_id = ? && object_id = ?";	
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 	 * @return string Returns the tag in normalized form.
601 601
 	 */ 
602 602
 	public function get_tag_id($tag) {
603
-		if(!isset($tag)) {
603
+		if (!isset($tag)) {
604 604
 			die("get_tag_id argument missing");
605 605
 			return false;
606 606
 		}
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 	 */ 
629 629
 
630 630
 	public function get_raw_tag_id($tag) {
631
-		if(!isset($tag)) {
631
+		if (!isset($tag)) {
632 632
 			die("get_tag_id argument missing");
633 633
 			return false;
634 634
 		}
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 	 * @return string Returns the tag in normalized form.
662 662
 	 */
663 663
 	public function tag_object($tagger_id, $object_id, $tag_string, $module, $skip_updates = 1) {
664
-		if($tag_string == '') {
664
+		if ($tag_string == '') {
665 665
 			// If an empty string was passed, just return true, don't die.
666 666
 			// die("Empty tag string passed");
667 667
 			return true;
@@ -702,10 +702,10 @@  discard block
 block discarded – undo
702 702
 	 * @return boolean True if successful, false otherwise.
703 703
 	 */
704 704
 	public function _tag_object_array($tagger_id, $object_id, $tagArray, $module) {
705
-		foreach($tagArray as $tag) {
705
+		foreach ($tagArray as $tag) {
706 706
 			$tag = trim($tag);
707
-			if(($tag != '') && (strlen($tag) <= $this->_MAX_TAG_LENGTH)) {
708
-				if(get_magic_quotes_gpc()) {
707
+			if (($tag != '') && (strlen($tag) <= $this->_MAX_TAG_LENGTH)) {
708
+				if (get_magic_quotes_gpc()) {
709 709
 					$tag = addslashes($tag);
710 710
 				}
711 711
 				$this->safe_tag($tagger_id, $object_id, $tag, $module);
@@ -731,12 +731,12 @@  discard block
 block discarded – undo
731 731
 			return $newwords;
732 732
 		}
733 733
 		# Perform tag parsing
734
-		if(get_magic_quotes_gpc()) {
734
+		if (get_magic_quotes_gpc()) {
735 735
 			$query = stripslashes(trim($tag_string));
736 736
 		} else {
737 737
 			$query = trim($tag_string);
738 738
 		}
739
-		$words = preg_split('/(")/', $query,-1,PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
739
+		$words = preg_split('/(")/', $query, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
740 740
 		$delim = 0;
741 741
 		foreach ($words as $key => $word)
742 742
 		{
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 	public function get_most_popular_tags($tagger_id = NULL, $offset = 0, $limit = 25) {
783 783
 		$adb = PearDatabase::getInstance();
784 784
 		$params = array();
785
-		if(isset($tagger_id) && ($tagger_id > 0)) {
785
+		if (isset($tagger_id) && ($tagger_id > 0)) {
786 786
 			$tagger_sql = "AND tagger_id = ?";
787 787
 			array_push($params, $tagger_id);
788 788
 		} else {
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 	public function count_tags($tagger_id = NULL) {
827 827
 		$adb = PearDatabase::getInstance();
828 828
 		$params = array();
829
-		if(isset($tagger_id) && ($tagger_id > 0)) {
829
+		if (isset($tagger_id) && ($tagger_id > 0)) {
830 830
 			$tagger_sql = "AND tagger_id = ?";
831 831
 			array_push($params, $tagger_id);
832 832
 		} else {
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
 	 * @return string Returns an HTML snippet that can be used directly as a tag cloud.
871 871
 	 */
872 872
 
873
-	public function get_tag_cloud_html($module="",$tagger_id = NULL,$obj_id= NULL,$num_tags = 100, $min_font_size = 10, $max_font_size = 20, $font_units = 'px', $span_class = '', $tag_page_url = '/tag/') {
873
+	public function get_tag_cloud_html($module = "", $tagger_id = NULL, $obj_id = NULL, $num_tags = 100, $min_font_size = 10, $max_font_size = 20, $font_units = 'px', $span_class = '', $tag_page_url = '/tag/') {
874 874
 		global $theme;
875
-		$theme_path="themes/".$theme."/";
876
-		$image_path=$theme_path."images/";	
877
-		$tag_list = $this->get_tag_cloud_tags($num_tags, $tagger_id,$module,$obj_id);
875
+		$theme_path = "themes/" . $theme . "/";
876
+		$image_path = $theme_path . "images/";	
877
+		$tag_list = $this->get_tag_cloud_tags($num_tags, $tagger_id, $module, $obj_id);
878 878
 		if (count($tag_list[0])) {
879 879
 			// Get the maximum qty of tagged objects in the set
880 880
 			$max_qty = max(array_values($tag_list[0]));
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 		if (0 == $spread) { // Divide by zero
891 891
 			$spread = 1;
892 892
 		}
893
-		$step = ($max_font_size - $min_font_size)/($spread);
893
+		$step = ($max_font_size - $min_font_size) / ($spread);
894 894
 
895 895
 		// Since the original tag_list is alphabetically ordered,
896 896
 		// we can now create the tag cloud by just putting a span
@@ -898,18 +898,18 @@  discard block
 block discarded – undo
898 898
 		// by $step.
899 899
 		$cloud_html = '';
900 900
 		$cloud_spans = array();
901
-		if($module =='')
901
+		if ($module == '')
902 902
 			$module = 'All';
903
-		if($module != 'All') {
903
+		if ($module != 'All') {
904 904
 			foreach ($tag_list[0] as $tag => $qty) {
905 905
 				$size = $min_font_size + ($qty - $min_qty) * $step;
906
-				$cloud_span[] = '<span id="tag_'.$tag_list[1][$tag].'" class="' . $span_class . '" onMouseOver=$("tagspan_'.$tag_list[1][$tag].'").style.display="inline"; onMouseOut=$("tagspan_'.$tag_list[1][$tag].'").style.display="none";><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module='.$module.'&search_tag=tag_search&query_string='. urlencode($tag) . '" style="font-size: '. $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a><span class="'. $span_class .'" id="tagspan_'.$tag_list[1][$tag].'" style="display:none;cursor:pointer;" onClick="DeleteTag('.$tag_list[1][$tag].','.$obj_id.');"><img src="' . vtiger_imageurl('del_tag.gif', $theme) . '"></span></span>';
906
+				$cloud_span[] = '<span id="tag_' . $tag_list[1][$tag] . '" class="' . $span_class . '" onMouseOver=$("tagspan_' . $tag_list[1][$tag] . '").style.display="inline"; onMouseOut=$("tagspan_' . $tag_list[1][$tag] . '").style.display="none";><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module=' . $module . '&search_tag=tag_search&query_string=' . urlencode($tag) . '" style="font-size: ' . $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a><span class="' . $span_class . '" id="tagspan_' . $tag_list[1][$tag] . '" style="display:none;cursor:pointer;" onClick="DeleteTag(' . $tag_list[1][$tag] . ',' . $obj_id . ');"><img src="' . vtiger_imageurl('del_tag.gif', $theme) . '"></span></span>';
907 907
 
908 908
 			}
909 909
 		} else {
910
-			foreach($tag_list[0] as $tag => $qty) {
910
+			foreach ($tag_list[0] as $tag => $qty) {
911 911
 				$size = $min_font_size + ($qty - $min_qty) * $step;
912
-				$cloud_span[] = '<span class="' . $span_class . '"><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module='.$module.'&search_tag=tag_search&query_string='. urlencode($tag) . '" style="font-size: '. $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a></span>';
912
+				$cloud_span[] = '<span class="' . $span_class . '"><a class="tagit" href="index.php?module=Home&action=UnifiedSearch&search_module=' . $module . '&search_tag=tag_search&query_string=' . urlencode($tag) . '" style="font-size: ' . $size . $font_units . '">' . htmlspecialchars(stripslashes($tag)) . '</a></span>';
913 913
 			}
914 914
 		}
915 915
 		$cloud_html = join("\n ", $cloud_span);
@@ -934,24 +934,24 @@  discard block
 block discarded – undo
934 934
 	 * values are numeric quantity of objects tagged with that tag.
935 935
 	 */
936 936
 
937
-	public function get_tag_cloud_tags($max = 100, $tagger_id = NULL,$module = "",$obj_id = NULL) {
937
+	public function get_tag_cloud_tags($max = 100, $tagger_id = NULL, $module = "", $obj_id = NULL) {
938 938
 		$adb = PearDatabase::getInstance();
939 939
 		$params = array();
940
-		if(isset($tagger_id) && ($tagger_id > 0)) {
940
+		if (isset($tagger_id) && ($tagger_id > 0)) {
941 941
 			$tagger_sql = " && tagger_id = ?";
942 942
 			array_push($params, $tagger_id);
943 943
 		} else {
944 944
 			$tagger_sql = "";
945 945
 		}
946 946
 
947
-		if($module != "") {
947
+		if ($module != "") {
948 948
 			$tagger_sql .= " && module = ?";
949 949
 			array_push($params, $module);
950 950
 		} else {
951 951
 			$tagger_sql .= "";
952 952
 		}
953 953
 
954
-		if(isset($obj_id) && $obj_id > 0) {
954
+		if (isset($obj_id) && $obj_id > 0) {
955 955
   			$tagger_sql .= " && object_id = ?";
956 956
 			array_push($params, $obj_id);
957 957
 		} else {
@@ -974,10 +974,10 @@  discard block
 block discarded – undo
974 974
 			$retarr[$row['tag']] = $row['quantity'];
975 975
 			$retarr1[$row['tag']] = $row['tag_id'];
976 976
 		}
977
-		if($retarr) ksort($retarr);
978
-		if($retarr1) ksort($retarr1);
979
-		$return_value[]=$retarr;
980
-		$return_value[]=$retarr1;
977
+		if ($retarr) ksort($retarr);
978
+		if ($retarr1) ksort($retarr1);
979
+		$return_value[] = $retarr;
980
+		$return_value[] = $retarr1;
981 981
 		return $return_value;
982 982
 
983 983
 	}
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
 
1011 1011
 	public function similar_tags($tag, $max = 100) {
1012 1012
 		$retarr = array();
1013
-		if(!isset($tag)) {
1013
+		if (!isset($tag)) {
1014 1014
 			return $retarr;
1015 1015
 		}
1016 1016
 		$adb = PearDatabase::getInstance();
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 		$sql = "SELECT matches.object_id, COUNT( matches.object_id ) AS num_common_tags
1100 1100
 			FROM ${prefix}freetagged_objects as matches
1101 1101
 			INNER JOIN ${prefix}freetags as tags ON ( tags.id = matches.tag_id )
1102
-			WHERE tags.tag IN (". generateQuestionMarks($tagArray) .")
1102
+			WHERE tags.tag IN (" . generateQuestionMarks($tagArray) . ")
1103 1103
 			GROUP BY matches.object_id
1104 1104
 			HAVING num_common_tags >= ?
1105 1105
 			ORDER BY num_common_tags DESC
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 		$rs = $adb->pquery($sql, array($tagArray, $threshold, $max_objects));
1109 1109
 		while ($row = $adb->fetch_array($rs)) {
1110
-			$retarr[] = array (
1110
+			$retarr[] = array(
1111 1111
 				'object_id' => $row['object_id'],
1112 1112
 				'strength' => ($row['num_common_tags'] / $numTags)
1113 1113
 				);
Please login to merge, or discard this patch.
libraries/log4php.debug/appenders/LoggerAppenderEcho.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      * @var boolean used internally to mark first append 
49 49
      * @access private 
50 50
      */
51
-    public $firstAppend    = true;
51
+    public $firstAppend = true;
52 52
     
53 53
     /**
54 54
      * Constructor.
Please login to merge, or discard this patch.
libraries/log4php.debug/appenders/LoggerAppenderRollingFile.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      *
70 70
      * @var integer 
71 71
      */
72
-    public $maxBackupIndex  = 1;
72
+    public $maxBackupIndex = 1;
73 73
     
74 74
     /**
75 75
      * @var string the filename expanded
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     public function rollOver()
124 124
     {
125 125
         // If maxBackups <= 0, then there is no file renaming to be done.
126
-        if($this->maxBackupIndex > 0) {
126
+        if ($this->maxBackupIndex > 0) {
127 127
             $fileName = $this->getExpandedFileName();
128 128
             // Delete the oldest file, to keep Windows happy.
129 129
             $file = $fileName . '.' . $this->maxBackupIndex;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     public function setMaxBackupIndex($maxBackups)
177 177
     {
178 178
         if (is_numeric($maxBackups))
179
-            $this->maxBackupIndex = abs((int)$maxBackups);
179
+            $this->maxBackupIndex = abs((int) $maxBackups);
180 180
     }
181 181
 
182 182
     /**
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
     public function setMaxFileSize($value)
207 207
     {
208 208
         $maxFileSize = null;
209
-        $numpart = substr($value,0, strlen($value) -2);
209
+        $numpart = substr($value, 0, strlen($value) - 2);
210 210
         $suffix  = strtoupper(substr($value, -2));
211 211
 
212 212
         switch ($suffix) {
213
-            case 'KB': $maxFileSize = (int)((int)$numpart * 1024); break;
214
-            case 'MB': $maxFileSize = (int)((int)$numpart * 1024 * 1024); break;
215
-            case 'GB': $maxFileSize = (int)((int)$numpart * 1024 * 1024 * 1024); break;
213
+            case 'KB': $maxFileSize = (int) ((int) $numpart * 1024); break;
214
+            case 'MB': $maxFileSize = (int) ((int) $numpart * 1024 * 1024); break;
215
+            case 'GB': $maxFileSize = (int) ((int) $numpart * 1024 * 1024 * 1024); break;
216 216
             default:
217 217
                 if (is_numeric($value)) {
218
-                    $maxFileSize = (int)$value;
218
+                    $maxFileSize = (int) $value;
219 219
                 }
220 220
         }
221 221
         
Please login to merge, or discard this patch.
libraries/log4php.debug/appenders/LoggerAppenderSocket.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  */
23 23
 if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
24 24
 
25
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT',       4446);
26
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT',    30);
25
+define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT', 4446);
26
+define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT', 30);
27 27
 
28 28
 require_once(LOG4PHP_DIR . '/LoggerAppenderSkeleton.php');
29 29
 require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
@@ -54,27 +54,27 @@  discard block
 block discarded – undo
54 54
      * {@link PHP_MANUAL#fsockopen}
55 55
      * @var string 
56 56
      */
57
-    public $remoteHost     = '';
57
+    public $remoteHost = '';
58 58
     
59 59
     /**
60 60
      * @var integer the network port.
61 61
      */
62
-    public $port           = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT;
62
+    public $port = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT;
63 63
     
64 64
     /**
65 65
      * @var boolean get event's location info.
66 66
      */
67
-    public $locationInfo   = false;
67
+    public $locationInfo = false;
68 68
     
69 69
     /**
70 70
      * @var integer connection timeout
71 71
      */
72
-    public $timeout        = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT;
72
+    public $timeout = LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT;
73 73
     
74 74
     /**
75 75
      * @var boolean output events via {@link LoggerXmlLayout}
76 76
      */
77
-    public $useXml         = false;
77
+    public $useXml = false;
78 78
     
79 79
     /**
80 80
      * @var boolean forward this option to {@link LoggerXmlLayout}. 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      * @var LoggerXmlLayout
87 87
      * @access private
88 88
      */
89
-    public $xmlLayout      = null;
89
+    public $xmlLayout = null;
90 90
     
91 91
     /**
92 92
      * @var boolean
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             LoggerLog::debug("LoggerAppenderSocket::activateOptions() socket error [$errno] $errstr");
118 118
             $this->closed = true;
119 119
         } else {
120
-            LoggerLog::debug("LoggerAppenderSocket::activateOptions() socket created [".$this->sp."]");
120
+            LoggerLog::debug("LoggerAppenderSocket::activateOptions() socket created [" . $this->sp . "]");
121 121
             if ($this->getUseXml()) {
122 122
                 $this->xmlLayout = LoggerLayout::factory('LoggerXmlLayout');
123 123
                 if ($this->xmlLayout === null) {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             }            
278 278
 
279 279
             // not sure about it...
280
-            @fflush ($this->sp);
280
+            @fflush($this->sp);
281 281
         } 
282 282
     }
283 283
 }
Please login to merge, or discard this patch.
libraries/log4php.debug/appenders/LoggerAppenderMailEvent.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -49,27 +49,27 @@  discard block
 block discarded – undo
49 49
     /**
50 50
      * @var string 'from' field
51 51
      */
52
-    public $from           = null;
52
+    public $from = null;
53 53
 
54 54
     /**
55 55
      * @var integer 'from' field
56 56
      */
57
-    public $port           = 25;
57
+    public $port = 25;
58 58
 
59 59
     /**
60 60
      * @var string hostname. 
61 61
      */
62
-    public $smtpHost       = null;
62
+    public $smtpHost = null;
63 63
 
64 64
     /**
65 65
      * @var string 'subject' field
66 66
      */
67
-    public $subject        = '';
67
+    public $subject = '';
68 68
 
69 69
     /**
70 70
      * @var string 'to' field
71 71
      */
72
-    public $to             = null;
72
+    public $to = null;
73 73
     
74 74
     /**
75 75
      * @access private
@@ -99,33 +99,33 @@  discard block
 block discarded – undo
99 99
     /**
100 100
      * @return string
101 101
      */
102
-    public function getFrom()      { return $this->from; }
102
+    public function getFrom() { return $this->from; }
103 103
     
104 104
     /**
105 105
      * @return integer
106 106
      */
107
-    public function getPort()      { return $this->port; }
107
+    public function getPort() { return $this->port; }
108 108
     
109 109
     /**
110 110
      * @return string
111 111
      */
112
-    public function getSmtpHost()  { return $this->smtpHost; }
112
+    public function getSmtpHost() { return $this->smtpHost; }
113 113
     
114 114
     /**
115 115
      * @return string
116 116
      */
117
-    public function getSubject()   { return $this->subject; }
117
+    public function getSubject() { return $this->subject; }
118 118
 
119 119
     /**
120 120
      * @return string
121 121
      */
122
-    public function getTo()        { return $this->to; }
122
+    public function getTo() { return $this->to; }
123 123
 
124
-    public function setFrom($from)             { $this->from = $from; }
125
-    public function setPort($port)             { $this->port = (int)$port; }
126
-    public function setSmtpHost($smtphost)     { $this->smtpHost = $smtpHost; }
127
-    public function setSubject($subject)       { $this->subject = $subject; }
128
-    public function setTo($to)                 { $this->to = $to; }
124
+    public function setFrom($from) { $this->from = $from; }
125
+    public function setPort($port) { $this->port = (int) $port; }
126
+    public function setSmtpHost($smtphost) { $this->smtpHost = $smtpHost; }
127
+    public function setSubject($subject) { $this->subject = $subject; }
128
+    public function setTo($to) { $this->to = $to; }
129 129
 
130 130
     public function append($event)
131 131
     {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         } 
144 144
 
145 145
         $smtpPort = $this->getPort();
146
-        $prevSmtpPort= ini_get('smtp_port');        
146
+        $prevSmtpPort = ini_get('smtp_port');        
147 147
         if ($smtpPort > 0 && $smtpPort < 65535) {
148 148
             ini_set('smtp_port', $smtpPort);
149 149
         } else {
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
             ":from=[{$from}]:to=[{$to}]:smtpHost=[{$smtpHost}]:smtpPort=[{$smtpPort}]"
156 156
         ); 
157 157
         
158
-        if (!@mail( $to, $this->getSubject(), 
158
+        if (!@mail($to, $this->getSubject(), 
159 159
             $this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), 
160 160
             "From: {$from}\r\n"
161 161
         )) {
162 162
             LoggerLog::debug("LoggerAppenderMailEvent::append() mail error");
163 163
         }
164 164
             
165
-        ini_set('SMTP',         $prevSmtpHost);
166
-        ini_set('smtp_port',    $prevSmtpPort);
165
+        ini_set('SMTP', $prevSmtpHost);
166
+        ini_set('smtp_port', $prevSmtpPort);
167 167
     }
168 168
 }
169 169
 
Please login to merge, or discard this patch.
libraries/log4php.debug/LoggerCategory.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,38 +41,38 @@  discard block
 block discarded – undo
41 41
      * appenders of their ancestors by default.
42 42
      * @var boolean
43 43
      */
44
-    public $additive       = true;
44
+    public $additive = true;
45 45
     
46 46
     /**
47 47
      * @var string fully qualified class name
48 48
      */  
49
-    public $fqcn           = 'LoggerCategory';
49
+    public $fqcn = 'LoggerCategory';
50 50
 
51 51
     /**
52 52
      * @var LoggerLevel The assigned level of this category.
53 53
      */
54
-    public $level          = null;
54
+    public $level = null;
55 55
     
56 56
     /**
57 57
      * @var string name of this category.
58 58
      */
59
-    public $name           = '';
59
+    public $name = '';
60 60
     
61 61
     /**
62 62
      * @var Logger The parent of this category.
63 63
      */
64
-    public $parent         = null;
64
+    public $parent = null;
65 65
 
66 66
     /**
67 67
      * @var LoggerHierarchy the object repository
68 68
      */
69
-    public $repository     = null; 
69
+    public $repository = null; 
70 70
 
71 71
     /**
72 72
      * @var array collection of appenders
73 73
      * @see LoggerAppender
74 74
      */
75
-    public $aai            = array();
75
+    public $aai = array();
76 76
     
77 77
 /* --------------------------------------------------------------------------*/
78 78
 /* --------------------------------------------------------------------------*/
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public function addAppender(&$newAppender)
97 97
     {
98 98
         $appenderName = $newAppender->getName();
99
-        $this->aai[$appenderName] =& $newAppender;
99
+        $this->aai[$appenderName] = & $newAppender;
100 100
     } 
101 101
             
102 102
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         }
161 161
         if ($errorLevel->isGreaterOrEqual($this->getEffectiveLevel())) {
162 162
             $this->forcedLog($this->fqcn, $caller, $errorLevel, $message);
163
-			$this->forcedLog($this->fqcn, $caller, $errorLevel, PHP_EOL.vtlib\Functions::getBacktrace(1));
163
+			$this->forcedLog($this->fqcn, $caller, $errorLevel, PHP_EOL . vtlib\Functions::getBacktrace(1));
164 164
         }
165 165
     }
166 166
   
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $enumAppenders = sizeof($appenderNames);
231 231
         for ($i = 0; $i < $enumAppenders; $i++) {
232 232
             $appenderName = $appenderNames[$i];
233
-            $appenders[] =& $this->aai[$appenderName];
233
+            $appenders[] = & $this->aai[$appenderName];
234 234
         }
235 235
         return $appenders; 
236 236
     }
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
      */
288 288
     public function getEffectiveLevel()
289 289
     {
290
-        for($c = $this; $c != null; $c = $c->parent) {
291
-            if($c->level !== null)
290
+        for ($c = $this; $c != null; $c = $c->parent) {
291
+            if ($c->level !== null)
292 292
             	return $c->level;
293 293
         }
294 294
         return null;
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
         if ($this->repository->isDisabled($level)) {
425 425
             return false;
426 426
         }
427
-        return (bool)($level->isGreaterOrEqual($this->getEffectiveLevel()));
427
+        return (bool) ($level->isGreaterOrEqual($this->getEffectiveLevel()));
428 428
     } 
429 429
 
430 430
     /**
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
      */
502 502
     public function setAdditivity($additive) 
503 503
     {
504
-        $this->additive = (bool)$additive;
504
+        $this->additive = (bool) $additive;
505 505
     }
506 506
     
507 507
     /**
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
      */
522 522
     public function setHierarchy(&$repository)
523 523
     {
524
-        $this->repository =& $repository;
524
+        $this->repository = & $repository;
525 525
     }
526 526
 
527 527
     /**
Please login to merge, or discard this patch.
libraries/log4php.debug/LoggerHierarchy.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     /**
87 87
      * @var boolean currently unused
88 88
      */
89
-    public $emittedNoAppenderWarning       = false;
89
+    public $emittedNoAppenderWarning = false;
90 90
 
91 91
     /**
92 92
      * @var boolean currently unused
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function LoggerHierarchy($root)
115 115
     {
116
-        $this->root    =& $root;
116
+        $this->root = & $root;
117 117
         // Enable all level levels by default.
118 118
         $this->setThreshold(LoggerLevel::getLevelAll());
119 119
         $this->root->setHierarchy($this);
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $enumLoggers = sizeof($loggerNames);
187 187
         for ($i = 0; $i < $enumLoggers; $i++) {
188 188
             $loggerName = $loggerNames[$i];
189
-            $loggers[] =& $this->ht[$loggerName];
189
+            $loggers[] = & $this->ht[$loggerName];
190 190
         }
191 191
         return $loggers; 
192 192
     }
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
     public function &getLoggerByFactory($name, $factory)
218 218
     {
219 219
         if (!isset($this->ht[$name])) {
220
-            LoggerLog::debug("LoggerHierarchy::getLoggerByFactory():name=[$name]:factory=[".get_class($factory)."] creating a new logger...");
220
+            LoggerLog::debug("LoggerHierarchy::getLoggerByFactory():name=[$name]:factory=[" . get_class($factory) . "] creating a new logger...");
221 221
             $this->ht[$name] = $factory->makeNewLoggerInstance($name);
222 222
             $this->ht[$name]->setHierarchy($this);
223 223
             $nodes = explode('.', $name);
224 224
             $firstNode = array_shift($nodes);
225
-            if ( $firstNode != $name && isset($this->ht[$firstNode])) {
225
+            if ($firstNode != $name && isset($this->ht[$firstNode])) {
226 226
                 LoggerLog::debug("LoggerHierarchy::getLogger($name) parent is now [$firstNode]");            
227
-                $this->ht[$name]->parent =& $this->ht[$firstNode];
227
+                $this->ht[$name]->parent = & $this->ht[$firstNode];
228 228
             } else {
229 229
                 LoggerLog::debug("LoggerHierarchy::getLogger($name) parent is now [root]");            
230
-                $this->ht[$name]->parent =& $this->root;
230
+                $this->ht[$name]->parent = & $this->root;
231 231
             } 
232 232
             if (sizeof($nodes) > 0) {
233 233
                 // find parent node
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                     $parentNode = "$firstNode.$node";
236 236
                     if (isset($this->ht[$parentNode]) && $parentNode != $name) {
237 237
                         LoggerLog::debug("LoggerHierarchy::getLogger($name) parent is now [$parentNode]");                    
238
-                        $this->ht[$name]->parent =& $this->ht[$parentNode];
238
+                        $this->ht[$name]->parent = & $this->ht[$parentNode];
239 239
                     }
240 240
                     $firstNode .= ".$node";
241 241
                 }
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
      */
315 315
     public function resetConfiguration()
316 316
     {
317
-        $root =& $this->getRootLogger();
317
+        $root = & $this->getRootLogger();
318 318
         
319 319
         $root->setLevel(LoggerLevel::getLevelDebug());
320 320
         $this->setThreshold(LoggerLevel::getLevelAll());
321 321
         $this->shutDown();
322
-        $loggers =& $this->getCurrentLoggers();
322
+        $loggers = & $this->getCurrentLoggers();
323 323
         $enumLoggers = sizeof($loggers);
324 324
         for ($i = 0; $i < $enumLoggers; $i++) {
325 325
             $loggers[$i]->setLevel(null);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     public function shutdown()
377 377
     {
378 378
         $this->root->removeAllAppenders();
379
-        $cats =& $this->getCurrentLoggers();
379
+        $cats = & $this->getCurrentLoggers();
380 380
         $enumCats = sizeof($cats);        
381 381
         if ($enumCats > 0) {
382 382
             for ($i = 0; $i < $enumCats; $i++) {
Please login to merge, or discard this patch.
libraries/log4php.debug/LoggerRoot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     /**
40 40
      * @var string name of logger 
41 41
      */
42
-    public $name   = 'root';
42
+    public $name = 'root';
43 43
 
44 44
     /**
45 45
      * @var object must be null for LoggerRoot
Please login to merge, or discard this patch.
libraries/nusoap/class.wsdl.php 1 patch
Spacing   +125 added lines, -127 removed lines patch added patch discarded remove patch
@@ -47,13 +47,13 @@  discard block
 block discarded – undo
47 47
 	public $proxypassword = '';
48 48
 	public $timeout = 0;
49 49
 	public $response_timeout = 30;
50
-	public $curl_options = array();	// User-specified cURL options
51
-	public $use_curl = false;			// whether to always try to use cURL
50
+	public $curl_options = array(); // User-specified cURL options
51
+	public $use_curl = false; // whether to always try to use cURL
52 52
 	// for HTTP authentication
53
-	public $username = '';				// Username for HTTP authentication
54
-	public $password = '';				// Password for HTTP authentication
55
-	public $authtype = '';				// Type of HTTP authentication
56
-	public $certRequest = array();		// Certificate for HTTP SSL authentication
53
+	public $username = ''; // Username for HTTP authentication
54
+	public $password = ''; // Password for HTTP authentication
55
+	public $authtype = ''; // Type of HTTP authentication
56
+	public $certRequest = array(); // Certificate for HTTP SSL authentication
57 57
 
58 58
     /**
59 59
      * constructor
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @param boolean $use_curl try to use cURL
70 70
      * @access public 
71 71
      */
72
-    public function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){
72
+    public function wsdl($wsdl = '', $proxyhost = false, $proxyport = false, $proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $curl_options = null, $use_curl = false) {
73 73
 		parent::nusoap_base();
74 74
 		$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
75 75
         $this->proxyhost = $proxyhost;
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
     		// Schema imports
104 104
     		foreach ($this->schemas as $ns => $list) {
105 105
     			foreach ($list as $xs) {
106
-					$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
106
+					$wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
107 107
 		            foreach ($xs->imports as $ns2 => $list2) {
108 108
 		                for ($ii = 0; $ii < count($list2); $ii++) {
109
-		                	if (! $list2[$ii]['loaded']) {
109
+		                	if (!$list2[$ii]['loaded']) {
110 110
 		                		/*
111 111
 		                		 * Substituted with line below
112 112
 		                		 * because of error "Warning: attempt to modify property of non-object"
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 								if ($url != '') {
118 118
 									$urlparts = parse_url($url);
119 119
 									if (!isset($urlparts['host'])) {
120
-										$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') .
121
-												substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
120
+										$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
121
+												substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
122 122
 									}
123
-									if (! in_array($url, $imported_urls)) {
123
+									if (!in_array($url, $imported_urls)) {
124 124
 					                	$this->parseWSDL($url);
125 125
 				                		$imported++;
126 126
 				                		$imported_urls[] = $url;
@@ -134,19 +134,19 @@  discard block
 block discarded – undo
134 134
     			}
135 135
     		}
136 136
     		// WSDL imports
137
-			$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
137
+			$wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
138 138
             foreach ($this->import as $ns => $list) {
139 139
                 for ($ii = 0; $ii < count($list); $ii++) {
140
-                	if (! $list[$ii]['loaded']) {
140
+                	if (!$list[$ii]['loaded']) {
141 141
                 		$this->import[$ns][$ii]['loaded'] = true;
142 142
                 		$url = $list[$ii]['location'];
143 143
 						if ($url != '') {
144 144
 							$urlparts = parse_url($url);
145 145
 							if (!isset($urlparts['host'])) {
146 146
 								$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
147
-										substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
147
+										substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1) . $urlparts['path'];
148 148
 							}
149
-							if (! in_array($url, $imported_urls)) {
149
+							if (!in_array($url, $imported_urls)) {
150 150
 			                	$this->parseWSDL($url);
151 151
 		                		$imported++;
152 152
 		                		$imported_urls[] = $url;
@@ -159,30 +159,28 @@  discard block
 block discarded – undo
159 159
             } 
160 160
 		}
161 161
         // add new data to operation data
162
-        foreach($this->bindings as $binding => $bindingData) {
162
+        foreach ($this->bindings as $binding => $bindingData) {
163 163
             if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
164
-                foreach($bindingData['operations'] as $operation => $data) {
164
+                foreach ($bindingData['operations'] as $operation => $data) {
165 165
                     $this->debug('post-parse data gathering for ' . $operation);
166 166
                     $this->bindings[$binding]['operations'][$operation]['input'] = 
167 167
 						isset($this->bindings[$binding]['operations'][$operation]['input']) ? 
168
-						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
169
-						$this->portTypes[ $bindingData['portType'] ][$operation]['input'];
168
+						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[$bindingData['portType']][$operation]['input']) : $this->portTypes[$bindingData['portType']][$operation]['input'];
170 169
                     $this->bindings[$binding]['operations'][$operation]['output'] = 
171 170
 						isset($this->bindings[$binding]['operations'][$operation]['output']) ?
172
-						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
173
-						$this->portTypes[ $bindingData['portType'] ][$operation]['output'];
174
-                    if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
175
-						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
171
+						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[$bindingData['portType']][$operation]['output']) : $this->portTypes[$bindingData['portType']][$operation]['output'];
172
+                    if (isset($this->messages[$this->bindings[$binding]['operations'][$operation]['input']['message']])) {
173
+						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[$this->bindings[$binding]['operations'][$operation]['input']['message']];
176 174
 					}
177
-					if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
178
-                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
175
+					if (isset($this->messages[$this->bindings[$binding]['operations'][$operation]['output']['message']])) {
176
+                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[$this->bindings[$binding]['operations'][$operation]['output']['message']];
179 177
                     }
180 178
                     // Set operation style if necessary, but do not override one already provided
181 179
 					if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) {
182 180
                         $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
183 181
                     }
184 182
                     $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
185
-                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
183
+                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[$bindingData['portType']][$operation]['documentation']) ? $this->portTypes[$bindingData['portType']][$operation]['documentation'] : '';
186 184
                     $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
187 185
                 } 
188 186
             } 
@@ -213,8 +211,8 @@  discard block
 block discarded – undo
213 211
 	        $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl);
214 212
 			$tr->request_method = 'GET';
215 213
 			$tr->useSOAPAction = false;
216
-			if($this->proxyhost && $this->proxyport){
217
-				$tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
214
+			if ($this->proxyhost && $this->proxyport) {
215
+				$tr->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
218 216
 			}
219 217
 			if ($this->authtype != '') {
220 218
 				$tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
@@ -223,8 +221,8 @@  discard block
 block discarded – undo
223 221
 			$wsdl_string = $tr->send('', $this->timeout, $this->response_timeout);
224 222
 			$this->appendDebug($tr->getDebug());
225 223
 			// catch errors
226
-			if($err = $tr->getError() ){
227
-				$errstr = 'Getting ' . $wsdl . ' - HTTP ERROR: '.$err;
224
+			if ($err = $tr->getError()) {
225
+				$errstr = 'Getting ' . $wsdl . ' - HTTP ERROR: ' . $err;
228 226
 				$this->debug($errstr);
229 227
 	            $this->setError($errstr);
230 228
 				unset($tr);
@@ -283,7 +281,7 @@  discard block
 block discarded – undo
283 281
         xml_parser_free($this->parser);
284 282
         $this->debug('Parsing WSDL done');
285 283
 		// catch wsdl parse errors
286
-		if($this->getError()){
284
+		if ($this->getError()) {
287 285
 			return false;
288 286
 		}
289 287
         return true;
@@ -320,8 +318,8 @@  discard block
 block discarded – undo
320 318
             // process attributes
321 319
             if (count($attrs) > 0) {
322 320
 				// register namespace declarations
323
-                foreach($attrs as $k => $v) {
324
-                    if (preg_match('/^xmlns/',$k)) {
321
+                foreach ($attrs as $k => $v) {
322
+                    if (preg_match('/^xmlns/', $k)) {
325 323
                         if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
326 324
                             $this->namespaces[$ns_prefix] = $v;
327 325
                         } else {
@@ -334,7 +332,7 @@  discard block
 block discarded – undo
334 332
                     }
335 333
                 }
336 334
                 // expand each attribute prefix to its namespace
337
-                foreach($attrs as $k => $v) {
335
+                foreach ($attrs as $k => $v) {
338 336
                     $k = strpos($k, ':') ? $this->expandQname($k) : $k;
339 337
                     if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
340 338
                         $v = strpos($v, ':') ? $this->expandQname($v) : $v;
@@ -441,8 +439,8 @@  discard block
 block discarded – undo
441 439
 					    case 'address':
442 440
 					        $this->ports[$this->currentPort]['location'] = $attrs['location'];
443 441
 					        $this->ports[$this->currentPort]['bindingType'] = $namespace;
444
-					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
445
-					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
442
+					        $this->bindings[$this->ports[$this->currentPort]['binding']]['bindingType'] = $namespace;
443
+					        $this->bindings[$this->ports[$this->currentPort]['binding']]['endpoint'] = $attrs['location'];
446 444
 					        break;
447 445
 					} 
448 446
 					break;
@@ -452,13 +450,13 @@  discard block
 block discarded – undo
452 450
 			case 'import':
453 451
 			    if (isset($attrs['location'])) {
454 452
                     $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
455
-                    $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
453
+                    $this->debug('parsing import ' . $attrs['namespace'] . ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]) . ')');
456 454
 				} else {
457 455
                     $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
458
-					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
459
-						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
456
+					if (!$this->getPrefixFromNamespace($attrs['namespace'])) {
457
+						$this->namespaces['ns' . (count($this->namespaces) + 1)] = $attrs['namespace'];
460 458
 					}
461
-                    $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
459
+                    $this->debug('parsing import ' . $attrs['namespace'] . ' - [no location] (' . count($this->import[$attrs['namespace']]) . ')');
462 460
 				}
463 461
 				break;
464 462
 			//wait for schema
@@ -509,7 +507,7 @@  discard block
 block discarded – undo
509 507
 	* @param string $name element name
510 508
 	* @access private 
511 509
 	*/
512
-	public function end_element($parser, $name){ 
510
+	public function end_element($parser, $name) { 
513 511
 		// unset schema status
514 512
 		if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
515 513
 			$this->status = "";
@@ -592,15 +590,15 @@  discard block
 block discarded – undo
592 590
 		}
593 591
 		$this->debug("getOperations for port '$portName' bindingType $bindingType");
594 592
 		// loop thru ports
595
-		foreach($this->ports as $port => $portData) {
593
+		foreach ($this->ports as $port => $portData) {
596 594
 			$this->debug("getOperations checking port $port bindingType " . $portData['bindingType']);
597 595
 			if ($portName == '' || $port == $portName) {
598 596
 				// binding type of port matches parameter
599 597
 				if ($portData['bindingType'] == $bindingType) {
600 598
 					$this->debug("getOperations found port $port bindingType $bindingType");
601 599
 					// merge bindings
602
-					if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
603
-						$ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
600
+					if (isset($this->bindings[$portData['binding']]['operations'])) {
601
+						$ops = array_merge($ops, $this->bindings[$portData['binding']]['operations']);
604 602
 					}
605 603
 				}
606 604
 			}
@@ -627,15 +625,15 @@  discard block
 block discarded – undo
627 625
 			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
628 626
 		}
629 627
 		// loop thru ports
630
-		foreach($this->ports as $port => $portData) {
628
+		foreach ($this->ports as $port => $portData) {
631 629
 			// binding type of port matches parameter
632 630
 			if ($portData['bindingType'] == $bindingType) {
633 631
 				// get binding
634 632
 				//foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
635
-				foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
633
+				foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
636 634
 					// note that we could/should also check the namespace here
637 635
 					if ($operation == $bOperation) {
638
-						$opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
636
+						$opData = $this->bindings[$portData['binding']]['operations'][$operation];
639 637
 					    return $opData;
640 638
 					} 
641 639
 				} 
@@ -658,11 +656,11 @@  discard block
 block discarded – undo
658 656
 			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
659 657
 		}
660 658
 		// loop thru ports
661
-		foreach($this->ports as $port => $portData) {
659
+		foreach ($this->ports as $port => $portData) {
662 660
 			// binding type of port matches parameter
663 661
 			if ($portData['bindingType'] == $bindingType) {
664 662
 				// loop through operations for the binding
665
-				foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
663
+				foreach ($this->bindings[$portData['binding']]['operations'] as $bOperation => $opData) {
666 664
 					if ($opData['soapAction'] == $soapAction) {
667 665
 					    return $opData;
668 666
 					} 
@@ -691,7 +689,7 @@  discard block
 block discarded – undo
691 689
     */
692 690
 	public function getTypeDef($type, $ns) {
693 691
 		$this->debug("in getTypeDef: type=$type, ns=$ns");
694
-		if ((! $ns) && isset($this->namespaces['tns'])) {
692
+		if ((!$ns) && isset($this->namespaces['tns'])) {
695 693
 			$ns = $this->namespaces['tns'];
696 694
 			$this->debug("in getTypeDef: type namespace forced to $ns");
697 695
 		}
@@ -749,7 +747,7 @@  discard block
 block discarded – undo
749 747
     *
750 748
     * @access private
751 749
     */
752
-    public function webDescription(){
750
+    public function webDescription() {
753 751
     	global $HTTP_SERVER_VARS;
754 752
 
755 753
 		if (isset($_SERVER)) {
@@ -761,7 +759,7 @@  discard block
 block discarded – undo
761 759
 		}
762 760
 
763 761
 		$b = '
764
-		<html><head><title>NuSOAP: '.$this->serviceName.'</title>
762
+		<html><head><title>NuSOAP: '.$this->serviceName . '</title>
765 763
 		<style type="text/css">
766 764
 		    body    { font-family: arial; color: #000000; background-color: #ffffff; margin: 0px 0px 0px 0px; }
767 765
 		    p       { font-family: arial; color: #000000; margin-top: 0px; margin-bottom: 12px; }
@@ -838,24 +836,24 @@  discard block
 block discarded – undo
838 836
 		<body>
839 837
 		<div class=content>
840 838
 			<br><br>
841
-			<div class=title>'.$this->serviceName.'</div>
839
+			<div class=title>'.$this->serviceName . '</div>
842 840
 			<div class=nav>
843
-				<p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
841
+				<p>View the <a href="'.$PHP_SELF . '?wsdl">WSDL</a> for the service.
844 842
 				Click on an operation name to view it&apos;s details.</p>
845 843
 				<ul>';
846
-				foreach($this->getOperations() as $op => $data){
844
+				foreach ($this->getOperations() as $op => $data) {
847 845
 				    $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
848 846
 				    // create hidden div
849 847
 				    $b .= "<div id='$op' class='hidden'>
850 848
 				    <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
851
-				    foreach($data as $donnie => $marie){ // loop through opdata
852
-						if($donnie == 'input' || $donnie == 'output'){ // show input/output data
853
-						    $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
854
-						    foreach($marie as $captain => $tenille){ // loop through data
855
-								if($captain == 'parts'){ // loop thru parts
849
+				    foreach ($data as $donnie => $marie) { // loop through opdata
850
+						if ($donnie == 'input' || $donnie == 'output') { // show input/output data
851
+						    $b .= "<font color='white'>" . ucfirst($donnie) . ':</font><br>';
852
+						    foreach ($marie as $captain => $tenille) { // loop through data
853
+								if ($captain == 'parts') { // loop thru parts
856 854
 								    $b .= "&nbsp;&nbsp;$captain:<br>";
857 855
 					                //if(is_array($tenille)){
858
-								    	foreach($tenille as $joanie => $chachi){
856
+								    	foreach ($tenille as $joanie => $chachi) {
859 857
 											$b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
860 858
 								    	}
861 859
 					        		//}
@@ -864,7 +862,7 @@  discard block
 block discarded – undo
864 862
 								}
865 863
 						    }
866 864
 						} else {
867
-						    $b .= "<font color='white'>".ucfirst($donnie).":</font> $marie<br>";
865
+						    $b .= "<font color='white'>" . ucfirst($donnie) . ":</font> $marie<br>";
868 866
 						}
869 867
 				    }
870 868
 					$b .= '</div>';
@@ -887,7 +885,7 @@  discard block
 block discarded – undo
887 885
 	{
888 886
 		$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
889 887
 		$xml .= "\n<definitions";
890
-		foreach($this->namespaces as $k => $v) {
888
+		foreach ($this->namespaces as $k => $v) {
891 889
 			$xml .= " xmlns:$k=\"$v\"";
892 890
 		} 
893 891
 		// 10.9.02 - add poulter fix for wsdl and tns declarations
@@ -900,7 +898,7 @@  discard block
 block discarded – undo
900 898
 		$xml .= '>'; 
901 899
 		// imports
902 900
 		if (sizeof($this->import) > 0) {
903
-			foreach($this->import as $ns => $list) {
901
+			foreach ($this->import as $ns => $list) {
904 902
 				foreach ($list as $ii) {
905 903
 					if ($ii['location'] != '') {
906 904
 						$xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
@@ -911,7 +909,7 @@  discard block
 block discarded – undo
911 909
 			} 
912 910
 		} 
913 911
 		// types
914
-		if (count($this->schemas)>=1) {
912
+		if (count($this->schemas) >= 1) {
915 913
 			$xml .= "\n<types>\n";
916 914
 			foreach ($this->schemas as $ns => $list) {
917 915
 				foreach ($list as $xs) {
@@ -922,10 +920,10 @@  discard block
 block discarded – undo
922 920
 		} 
923 921
 		// messages
924 922
 		if (count($this->messages) >= 1) {
925
-			foreach($this->messages as $msgName => $msgParts) {
923
+			foreach ($this->messages as $msgName => $msgParts) {
926 924
 				$xml .= "\n<message name=\"" . $msgName . '">';
927
-				if(is_array($msgParts)){
928
-					foreach($msgParts as $partName => $partType) {
925
+				if (is_array($msgParts)) {
926
+					foreach ($msgParts as $partName => $partType) {
929 927
 						// print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
930 928
 						if (strpos($partType, ':')) {
931 929
 						    $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
@@ -933,7 +931,7 @@  discard block
 block discarded – undo
933 931
 						    // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
934 932
 						    $typePrefix = 'xsd';
935 933
 						} else {
936
-						    foreach($this->typemap as $ns => $types) {
934
+						    foreach ($this->typemap as $ns => $types) {
937 935
 						        if (isset($types[$partType])) {
938 936
 						            $typePrefix = $this->getPrefixFromNamespace($ns);
939 937
 						        } 
@@ -963,13 +961,13 @@  discard block
 block discarded – undo
963 961
 		if (count($this->bindings) >= 1) {
964 962
 			$binding_xml = '';
965 963
 			$portType_xml = '';
966
-			foreach($this->bindings as $bindingName => $attrs) {
964
+			foreach ($this->bindings as $bindingName => $attrs) {
967 965
 				$binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
968 966
 				$binding_xml .= "\n" . '  <soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
969 967
 				$portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
970
-				foreach($attrs['operations'] as $opName => $opParts) {
968
+				foreach ($attrs['operations'] as $opName => $opParts) {
971 969
 					$binding_xml .= "\n" . '  <operation name="' . $opName . '">';
972
-					$binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $opParts['style'] . '"/>';
970
+					$binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="' . $opParts['style'] . '"/>';
973 971
 					if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
974 972
 						$enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
975 973
 					} else {
@@ -988,7 +986,7 @@  discard block
 block discarded – undo
988 986
 					    $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
989 987
 					} 
990 988
 					$portType_xml .= '>';
991
-					if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
989
+					if (isset($opParts['documentation']) && $opParts['documentation'] != '') {
992 990
 						$portType_xml .= "\n" . '    <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
993 991
 					}
994 992
 					$portType_xml .= "\n" . '    <input message="tns:' . $opParts['input']['message'] . '"/>';
@@ -1003,7 +1001,7 @@  discard block
 block discarded – undo
1003 1001
 		// services
1004 1002
 		$xml .= "\n<service name=\"" . $this->serviceName . '">';
1005 1003
 		if (count($this->ports) >= 1) {
1006
-			foreach($this->ports as $pName => $attrs) {
1004
+			foreach ($this->ports as $pName => $attrs) {
1007 1005
 				$xml .= "\n" . '  <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
1008 1006
 				$xml .= "\n" . '    <soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
1009 1007
 				$xml .= "\n" . '  </port>';
@@ -1118,7 +1116,7 @@  discard block
 block discarded – undo
1118 1116
 
1119 1117
 		// Get encoding style for output and set to current
1120 1118
 		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1121
-		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1119
+		if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1122 1120
 			$encodingStyle = $opData['output']['encodingStyle'];
1123 1121
 			$enc_style = $encodingStyle;
1124 1122
 		}
@@ -1213,7 +1211,7 @@  discard block
 block discarded – undo
1213 1211
 		
1214 1212
 		// Get encoding style for output and set to current
1215 1213
 		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1216
-		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1214
+		if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1217 1215
 			$encodingStyle = $opData['output']['encodingStyle'];
1218 1216
 			$enc_style = $encodingStyle;
1219 1217
 		}
@@ -1228,10 +1226,10 @@  discard block
 block discarded – undo
1228 1226
 			if (is_array($parameters)) {
1229 1227
 				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
1230 1228
 				$this->debug('have ' . $parametersArrayType . ' parameters');
1231
-				foreach($opData[$direction]['parts'] as $name => $type) {
1232
-					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
1229
+				foreach ($opData[$direction]['parts'] as $name => $type) {
1230
+					$this->debug('serializing part "' . $name . '" of type "' . $type . '"');
1233 1231
 					// Track encoding style
1234
-					if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
1232
+					if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
1235 1233
 						$encodingStyle = $opData[$direction]['encodingStyle'];			
1236 1234
 						$enc_style = $encodingStyle;
1237 1235
 					} else {
@@ -1271,11 +1269,11 @@  discard block
 block discarded – undo
1271 1269
 	 * @return string value serialized as an XML string
1272 1270
 	 * @access private
1273 1271
 	 */
1274
-	public function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
1272
+	public function serializeType($name, $type, $value, $use = 'encoded', $encodingStyle = false, $unqualified = false)
1275 1273
 	{
1276 1274
 		$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
1277 1275
 		$this->appendDebug("value=" . $this->varDump($value));
1278
-		if($use == 'encoded' && $encodingStyle) {
1276
+		if ($use == 'encoded' && $encodingStyle) {
1279 1277
 			$encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
1280 1278
 		}
1281 1279
 
@@ -1319,7 +1317,7 @@  discard block
 block discarded – undo
1319 1317
 				$this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
1320 1318
 			}
1321 1319
 
1322
-			if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){
1320
+			if ($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/') {
1323 1321
 				$this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
1324 1322
 				if ($unqualified && $use == 'literal') {
1325 1323
 					$elementNS = " xmlns=\"\"";
@@ -1340,7 +1338,7 @@  discard block
 block discarded – undo
1340 1338
 					return $this->serialize_val($value, $name, false, false, false, false, $use);
1341 1339
 				}
1342 1340
 		    	if ($uqType == 'boolean') {
1343
-		    		if ((is_string($value) && $value == 'false') || (! $value)) {
1341
+		    		if ((is_string($value) && $value == 'false') || (!$value)) {
1344 1342
 						$value = 'false';
1345 1343
 					} else {
1346 1344
 						$value = 'true';
@@ -1370,7 +1368,7 @@  discard block
 block discarded – undo
1370 1368
 				$this->debug('in serializeType: appears to be Apache SOAP type');
1371 1369
 				if ($uqType == 'Map') {
1372 1370
 					$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
1373
-					if (! $tt_prefix) {
1371
+					if (!$tt_prefix) {
1374 1372
 						$this->debug('in serializeType: Add namespace for Apache SOAP type');
1375 1373
 						$tt_prefix = 'ns' . rand(1000, 9999);
1376 1374
 						$this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
@@ -1378,11 +1376,11 @@  discard block
 block discarded – undo
1378 1376
 						$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
1379 1377
 					}
1380 1378
 					$contents = '';
1381
-					foreach($value as $k => $v) {
1379
+					foreach ($value as $k => $v) {
1382 1380
 						$this->debug("serializing map element: key $k, value $v");
1383 1381
 						$contents .= '<item>';
1384
-						$contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
1385
-						$contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
1382
+						$contents .= $this->serialize_val($k, 'key', false, false, false, false, $use);
1383
+						$contents .= $this->serialize_val($v, 'value', false, false, false, false, $use);
1386 1384
 						$contents .= '</item>';
1387 1385
 					}
1388 1386
 					if ($use == 'literal') {
@@ -1404,7 +1402,7 @@  discard block
 block discarded – undo
1404 1402
 			$ns = '';
1405 1403
 			$uqType = $type;
1406 1404
 		}
1407
-		if(!$typeDef = $this->getTypeDef($uqType, $ns)){
1405
+		if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
1408 1406
 			$this->setError("$type ($uqType) is not a supported type.");
1409 1407
 			$this->debug("in serializeType: $type ($uqType) is not a supported type.");
1410 1408
 			return false;
@@ -1421,7 +1419,7 @@  discard block
 block discarded – undo
1421 1419
 			return false;
1422 1420
 		}
1423 1421
 		$phpType = $typeDef['phpType'];
1424
-		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); 
1422
+		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '')); 
1425 1423
 		// if php type == struct, map value to the <all> element names
1426 1424
 		if ($phpType == 'struct') {
1427 1425
 			if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
@@ -1501,14 +1499,14 @@  discard block
 block discarded – undo
1501 1499
 						':arrayType="' .
1502 1500
 						$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
1503 1501
 						':' .
1504
-						$this->getLocalPart($typeDef['arrayType'])."[0]\"/>";
1502
+						$this->getLocalPart($typeDef['arrayType']) . "[0]\"/>";
1505 1503
 				}
1506 1504
 				$this->debug("in serializeType: returning: $xml");
1507 1505
 				return $xml;
1508 1506
 			}
1509 1507
 			if (isset($typeDef['multidimensional'])) {
1510 1508
 				$nv = array();
1511
-				foreach($value as $v) {
1509
+				foreach ($value as $v) {
1512 1510
 					$cols = ',' . sizeof($v);
1513 1511
 					$nv = array_merge($nv, $v);
1514 1512
 				} 
@@ -1519,10 +1517,10 @@  discard block
 block discarded – undo
1519 1517
 			if (is_array($value) && sizeof($value) >= 1) {
1520 1518
 				$rows = sizeof($value);
1521 1519
 				$contents = '';
1522
-				foreach($value as $k => $v) {
1520
+				foreach ($value as $k => $v) {
1523 1521
 					$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
1524 1522
 					//if (strpos($typeDef['arrayType'], ':') ) {
1525
-					if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
1523
+					if (!in_array($typeDef['arrayType'], $this->typemap['http://www.w3.org/2001/XMLSchema'])) {
1526 1524
 					    $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
1527 1525
 					} else {
1528 1526
 					    $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
@@ -1537,11 +1535,11 @@  discard block
 block discarded – undo
1537 1535
 					.$contents
1538 1536
 					."</$name>";
1539 1537
 			} else {
1540
-				$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').':Array" '.
1538
+				$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') . ':Array" ' .
1541 1539
 					$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/')
1542 1540
 					.':arrayType="'
1543 1541
 					.$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType']))
1544
-					.":".$this->getLocalPart($typeDef['arrayType'])."[$rows$cols]\">"
1542
+					.":" . $this->getLocalPart($typeDef['arrayType']) . "[$rows$cols]\">"
1545 1543
 					.$contents
1546 1544
 					."</$name>";
1547 1545
 			}
@@ -1621,7 +1619,7 @@  discard block
 block discarded – undo
1621 1619
 					$this->debug("no value provided for attribute $aName");
1622 1620
 				}
1623 1621
 				if ($xname) {
1624
-					$xml .=  " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
1622
+					$xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
1625 1623
 				}
1626 1624
 			} 
1627 1625
 		} else {
@@ -1642,7 +1640,7 @@  discard block
 block discarded – undo
1642 1640
 	 * @return string value serialized as an XML string
1643 1641
 	 * @access private
1644 1642
 	 */
1645
-	public function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) {
1643
+	public function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use = 'encoded', $encodingStyle = false) {
1646 1644
 		$this->debug("in serializeComplexTypeElements for XML Schema type $ns:$uqType");
1647 1645
 		$xml = '';
1648 1646
 		if (isset($typeDef['extensionBase'])) {
@@ -1669,7 +1667,7 @@  discard block
 block discarded – undo
1669 1667
 				$xvalue = array();
1670 1668
 			}
1671 1669
 			// toggle whether all elements are present - ideally should validate against schema
1672
-			if (count($typeDef['elements']) != count($xvalue)){
1670
+			if (count($typeDef['elements']) != count($xvalue)) {
1673 1671
 				$optionals = true;
1674 1672
 			}
1675 1673
 			foreach ($typeDef['elements'] as $eName => $attrs) {
@@ -1682,8 +1680,8 @@  discard block
 block discarded – undo
1682 1680
 				// if user took advantage of a minOccurs=0, then only serialize named parameters
1683 1681
 				if (isset($optionals)
1684 1682
 				    && (!isset($xvalue[$eName])) 
1685
-					&& ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
1686
-					){
1683
+					&& ((!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
1684
+					) {
1687 1685
 					if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
1688 1686
 						$this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
1689 1687
 					}
@@ -1748,15 +1746,15 @@  discard block
 block discarded – undo
1748 1746
 	* @see nusoap_xmlschema
1749 1747
 	* @access public
1750 1748
 	*/
1751
-	public function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') {
1749
+	public function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = array(), $attrs = array(), $arrayType = '') {
1752 1750
 		if (count($elements) > 0) {
1753 1751
 			$eElements = array();
1754
-	    	foreach($elements as $n => $e){
1752
+	    	foreach ($elements as $n => $e) {
1755 1753
 	            // expand each element
1756 1754
 	            $ee = array();
1757 1755
 	            foreach ($e as $k => $v) {
1758
-		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
1759
-		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
1756
+		            $k = strpos($k, ':') ? $this->expandQname($k) : $k;
1757
+		            $v = strpos($v, ':') ? $this->expandQname($v) : $v;
1760 1758
 		            $ee[$k] = $v;
1761 1759
 		    	}
1762 1760
 	    		$eElements[$n] = $ee;
@@ -1765,11 +1763,11 @@  discard block
 block discarded – undo
1765 1763
 		}
1766 1764
 		
1767 1765
 		if (count($attrs) > 0) {
1768
-	    	foreach($attrs as $n => $a){
1766
+	    	foreach ($attrs as $n => $a) {
1769 1767
 	            // expand each attribute
1770 1768
 	            foreach ($a as $k => $v) {
1771
-		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
1772
-		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
1769
+		            $k = strpos($k, ':') ? $this->expandQname($k) : $k;
1770
+		            $v = strpos($v, ':') ? $this->expandQname($v) : $v;
1773 1771
 		            $aa[$k] = $v;
1774 1772
 		    	}
1775 1773
 	    		$eAttrs[$n] = $aa;
@@ -1777,11 +1775,11 @@  discard block
 block discarded – undo
1777 1775
 	    	$attrs = $eAttrs;
1778 1776
 		}
1779 1777
 
1780
-		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1781
-		$arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
1778
+		$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1779
+		$arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
1782 1780
 
1783 1781
 		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
1784
-		$this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
1782
+		$this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
1785 1783
 	}
1786 1784
 
1787 1785
 	/**
@@ -1795,8 +1793,8 @@  discard block
 block discarded – undo
1795 1793
 	* @see nusoap_xmlschema
1796 1794
 	* @access public
1797 1795
 	*/
1798
-	public function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
1799
-		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1796
+	public function addSimpleType($name, $restrictionBase = '', $typeClass = 'simpleType', $phpType = 'scalar', $enumeration = array()) {
1797
+		$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1800 1798
 
1801 1799
 		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
1802 1800
 		$this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
@@ -1828,7 +1826,7 @@  discard block
 block discarded – undo
1828 1826
 	* @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
1829 1827
 	* @access public 
1830 1828
 	*/
1831
-	public function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){
1829
+	public function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = '') {
1832 1830
 		if ($use == 'encoded' && $encodingStyle == '') {
1833 1831
 			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1834 1832
 		}
@@ -1852,7 +1850,7 @@  discard block
 block discarded – undo
1852 1850
 		}
1853 1851
 
1854 1852
 		// get binding
1855
-		$this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
1853
+		$this->bindings[$this->serviceName . 'Binding']['operations'][$name] =
1856 1854
 		array(
1857 1855
 		'name' => $name,
1858 1856
 		'binding' => $this->serviceName . 'Binding',
@@ -1876,29 +1874,29 @@  discard block
 block discarded – undo
1876 1874
 		'documentation' => $documentation); 
1877 1875
 		// add portTypes
1878 1876
 		// add messages
1879
-		if($in)
1877
+		if ($in)
1880 1878
 		{
1881
-			foreach($in as $pName => $pType)
1879
+			foreach ($in as $pName => $pType)
1882 1880
 			{
1883
-				if(strpos($pType,':')) {
1884
-					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
1881
+				if (strpos($pType, ':')) {
1882
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
1885 1883
 				}
1886
-				$this->messages[$name.'Request'][$pName] = $pType;
1884
+				$this->messages[$name . 'Request'][$pName] = $pType;
1887 1885
 			}
1888 1886
 		} else {
1889
-            $this->messages[$name.'Request']= '0';
1887
+            $this->messages[$name . 'Request'] = '0';
1890 1888
         }
1891
-		if($out)
1889
+		if ($out)
1892 1890
 		{
1893
-			foreach($out as $pName => $pType)
1891
+			foreach ($out as $pName => $pType)
1894 1892
 			{
1895
-				if(strpos($pType,':')) {
1896
-					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
1893
+				if (strpos($pType, ':')) {
1894
+					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)) . ":" . $this->getLocalPart($pType);
1897 1895
 				}
1898
-				$this->messages[$name.'Response'][$pName] = $pType;
1896
+				$this->messages[$name . 'Response'][$pName] = $pType;
1899 1897
 			}
1900 1898
 		} else {
1901
-            $this->messages[$name.'Response']= '0';
1899
+            $this->messages[$name . 'Response'] = '0';
1902 1900
         }
1903 1901
 		return true;
1904 1902
 	} 
Please login to merge, or discard this patch.