Completed
Push — developer ( 31cfdf...98a6c9 )
by Błażej
70:35 queued 28:41
created
include/CRMEntity.php 1 patch
Doc Comments   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -374,6 +374,11 @@  discard block
 block discarded – undo
374 374
 	}
375 375
 
376 376
 	// Function which returns the value based on result type (array / ADODB ResultSet)
377
+
378
+	/**
379
+	 * @param integer $index
380
+	 * @param string $columnname
381
+	 */
377 382
 	private function resolve_query_result_value($result, $index, $columnname)
378 383
 	{
379 384
 		$adb = PearDatabase::getInstance();
@@ -633,7 +638,7 @@  discard block
 block discarded – undo
633 638
 	}
634 639
 
635 640
 	/** Function to delete a record in the specifed table
636
-	 * @param $table_name -- table name:: Type varchar
641
+	 * @param string $table_name -- table name:: Type varchar
637 642
 	 * The function will delete a record .The id is obtained from the class variable $this->id and the columnname got from $this->tab_name_index[$table_name]
638 643
 	 */
639 644
 	public function deleteRelation($table_name)
@@ -817,6 +822,7 @@  discard block
 block discarded – undo
817 822
 
818 823
 	/** Function to saves the values in all the tables mentioned in the class variable $tab_name for the specified module
819 824
 	 * @param $module -- module:: Type varchar
825
+	 * @param string $module_name
820 826
 	 */
821 827
 	public function save($module_name, $fileid = '')
822 828
 	{
@@ -2562,10 +2568,10 @@  discard block
 block discarded – undo
2562 2568
 
2563 2569
 	/**
2564 2570
 	 *
2565
-	 * @param <type> $module
2566
-	 * @param <type> $user
2571
+	 * @param Users $user
2567 2572
 	 * @param <type> $parentRole
2568 2573
 	 * @param <type> $userGroups
2574
+	 * @param string $tableName
2569 2575
 	 */
2570 2576
 	protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups)
2571 2577
 	{
Please login to merge, or discard this patch.
include/recaptcha/recaptchalib.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -206,6 +206,9 @@  discard block
 block discarded – undo
206 206
 }
207 207
 /* Mailhide related code */
208 208
 
209
+/**
210
+ * @param string $ky
211
+ */
209 212
 function _recaptcha_aes_encrypt($val, $ky)
210 213
 {
211 214
 	if (!function_exists("mcrypt_encrypt")) {
@@ -217,6 +220,9 @@  discard block
 block discarded – undo
217 220
 	return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
218 221
 }
219 222
 
223
+/**
224
+ * @param null|string $x
225
+ */
220 226
 function _recaptcha_mailhide_urlbase64($x)
221 227
 {
222 228
 	return strtr(base64_encode($x), '+/', '-_');
Please login to merge, or discard this patch.
include/Tracker.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -59,6 +59,8 @@
 block discarded – undo
59 59
 	 * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
60 60
 	 * All Rights Reserved.
61 61
 	 * Contributor(s): ______________________________________..
62
+	 * @param string $item_id
63
+	 * @param string $item_summary
62 64
 	 */
63 65
 	public function track_view($user_id, $current_module, $item_id, $item_summary)
64 66
 	{
Please login to merge, or discard this patch.
libraries/freetag/freetag.class.php 2 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -405,6 +405,7 @@  discard block
 block discarded – undo
405 405
 	 * @param int The unique ID of the person who tagged the object with this tag.
406 406
 	 * @param int The unique ID of the object in question.
407 407
 	 * @param string A raw string from a web form containing tags.
408
+	 * @param string $tag
408 409
 	 *
409 410
 	 * @return boolean Returns true if successful, false otherwise. Does not operate as a transaction.
410 411
 	 */ 
@@ -662,7 +663,7 @@  discard block
 block discarded – undo
662 663
 	 * @param string The raw string form of the tag to delete. See above for vtiger_notes.
663 664
 	 * @param int Whether to skip the update portion for objects that haven't been tagged. (Default: 1)
664 665
 	 *
665
-	 * @return string Returns the tag in normalized form.
666
+	 * @return boolean Returns the tag in normalized form.
666 667
 	 */
667 668
 	public function tag_object($tagger_id, $object_id, $tag_string, $module, $skip_updates = 1) {
668 669
 		if($tag_string == '') {
@@ -1127,6 +1128,10 @@  discard block
 block discarded – undo
1127 1128
 	 * @param string The text to output
1128 1129
 	 * @return boolean Always returns true
1129 1130
 	 */
1131
+
1132
+	/**
1133
+	 * @param string $text
1134
+	 */
1130 1135
 	public function debug_text($text) {
1131 1136
 		if ($this->_debug) {
1132 1137
 			echo "$text<br>\n";
Please login to merge, or discard this 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
-	var $_block_multiuser_tag_on_object =0;
68
+	var $_block_multiuser_tag_on_object = 0;
69 69
 	/**
70 70
 	 * @access private
71 71
 	 * @param bool Whether to use persistent ADODB connections. False by default.
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * @return An array of Object ID numbers that reference your original objects.
156 156
 	 */ 
157 157
 	public function get_objects_with_tag($tag, $offset = 0, $limit = 100, $tagger_id = NULL) {
158
-		if(!isset($tag)) {
158
+		if (!isset($tag)) {
159 159
 			return false;
160 160
 		}		
161 161
 		$adb = PearDatabase::getInstance();
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 		$where = "tag = ? ";
164 164
 		$params = array($tag);
165 165
 
166
-		if(isset($tagger_id) && ($tagger_id > 0)) {
166
+		if (isset($tagger_id) && ($tagger_id > 0)) {
167 167
 			$where .= "AND tagger_id = ? ";
168 168
 			array_push($params, $tagger_id);
169 169
 		} 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 	 * @return An array of Object ID numbers that reference your original objects.
202 202
 	 */ 
203 203
 	public function get_objects_with_tag_all($tag, $tagger_id = NULL) {
204
-		if(!isset($tag)) {
204
+		if (!isset($tag)) {
205 205
 			return false;
206 206
 		}		
207 207
 		$adb = PearDatabase::getInstance();
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 		$where = "tag = ? ";
210 210
 		$params = array($tag);
211 211
 
212
-		if(isset($tagger_id) && ($tagger_id > 0)) {
212
+		if (isset($tagger_id) && ($tagger_id > 0)) {
213 213
 			$where .= "AND tagger_id = ? ";
214 214
 			array_push($params, $tagger_id);
215 215
 		} 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 			return $retarr;
254 254
 		}
255 255
 		$params = array($tagArray);
256
-		if(isset($tagger_id) && ($tagger_id > 0)) {
256
+		if (isset($tagger_id) && ($tagger_id > 0)) {
257 257
 			$tagger_sql = "AND tagger_id = ?";
258 258
 			array_push($params, $tagger_id);
259 259
 		} else {
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 		$sql = "SELECT ${prefix}freetagged_objects.object_id, tag, COUNT(DISTINCT tag) AS uniques
275 275
 			FROM ${prefix}freetagged_objects 
276 276
 			INNER JOIN ${prefix}freetags ON (${prefix}freetagged_objects.tag_id = ${prefix}freetags.id)
277
-			WHERE ${prefix}freetags.tag IN (". generateQuestionMarks($tagArray) .")
277
+			WHERE ${prefix}freetags.tag IN (" . generateQuestionMarks($tagArray) . ")
278 278
 			$tagger_sql
279 279
 			GROUP BY ${prefix}freetagged_objects.object_id
280 280
 			HAVING uniques = $numTags
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 	 * @return An array of Object ID numbers that reference your original objects.
305 305
 	 */ 
306 306
 	public function get_objects_with_tag_id($tag_id, $offset = 0, $limit = 100, $tagger_id = NULL) {
307
-		if(!isset($tag_id)) {
307
+		if (!isset($tag_id)) {
308 308
 			return false;
309 309
 		}		
310 310
 		$adb = PearDatabase::getInstance();
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		$where = "id = ? ";
313 313
 		$params = array($tag_id);
314 314
 		
315
-		if(isset($tagger_id) && ($tagger_id > 0)) {
315
+		if (isset($tagger_id) && ($tagger_id > 0)) {
316 316
 			$where .= "AND tagger_id = ?";
317 317
 			array_push($params, $tagger_id);
318 318
 		} 
@@ -353,19 +353,19 @@  discard block
 block discarded – undo
353 353
 	 *	 - 'tagger_id' => The unique ID of the person who tagged the object with this tag.
354 354
 	 */ 
355 355
 	public function get_tags_on_object($object_id, $offset = 0, $limit = 10, $tagger_id = NULL) {
356
-		if(!isset($object_id)) {
356
+		if (!isset($object_id)) {
357 357
 			return false;
358 358
 		}	
359 359
 		
360 360
 		$where = "object_id = ? ";
361 361
 		$params = array($object_id);
362 362
 			
363
-		if(isset($tagger_id) && ($tagger_id > 0)) {
363
+		if (isset($tagger_id) && ($tagger_id > 0)) {
364 364
 			$where .= "AND tagger_id = ? ";
365 365
 			array_push($params, $tagger_id);
366 366
 		} 
367 367
 
368
-		if($limit <= 0) {
368
+		if ($limit <= 0) {
369 369
 			$limit_sql = "";
370 370
 		} else {
371 371
 			$limit_sql = "LIMIT $offset, $limit";
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */ 
411 411
 
412 412
 	public function safe_tag($tagger_id, $object_id, $tag, $module) {
413
-		if(!isset($tagger_id)||!isset($object_id)||!isset($tag)) {
413
+		if (!isset($tagger_id) || !isset($object_id) || !isset($tag)) {
414 414
 			die("safe_tag argument missing");
415 415
 			return false;
416 416
 		}
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 			
438 438
 		array_push($params, $object_id, $normalized_tag);
439 439
 		$rs = $adb->pquery($sql, $params);
440
-		if($rs->fields['count'] > 0) {
440
+		if ($rs->fields['count'] > 0) {
441 441
 			return true;
442 442
 		}
443 443
 		// Then see if a raw tag in this form exists.
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 			WHERE raw_tag = ? ";
447 447
 		$rs = $adb->pquery($sql, array($tag));
448 448
 		$row = $adb->fetch_array($rs);
449
-		if($row) {
449
+		if ($row) {
450 450
 			$tag_id = $row['id'];
451 451
 		} else {
452 452
 			// Add new tag! 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
 			$rs = $adb->pquery($sql, $params);
457 457
 			
458 458
 		}
459
-		if(!($tag_id > 0)) {
459
+		if (!($tag_id > 0)) {
460 460
 			return false;
461 461
 		}
462 462
 		$sql = "INSERT INTO ${prefix}freetagged_objects
@@ -513,14 +513,14 @@  discard block
 block discarded – undo
513 513
 	 * @return string Returns the tag in normalized form.
514 514
 	 */ 
515 515
 	public function delete_object_tag($tagger_id, $object_id, $tag) {
516
-		if(!isset($tagger_id)||!isset($object_id)||!isset($tag)) {
516
+		if (!isset($tagger_id) || !isset($object_id) || !isset($tag)) {
517 517
 			die("delete_object_tag argument missing");
518 518
 			return false;
519 519
 		}
520 520
 		$adb = PearDatabase::getInstance();
521 521
 		$tag_id = $this->get_raw_tag_id($tag);
522 522
 		$prefix = $this->_table_prefix;
523
-		if($tag_id > 0) {
523
+		if ($tag_id > 0) {
524 524
 
525 525
 			$sql = "DELETE FROM ${prefix}freetagged_objects
526 526
 				WHERE tagger_id = ? && object_id = ? && tag_id = ? LIMIT 1";
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 	public function delete_all_object_tags($object_id) {
548 548
 		$adb = PearDatabase::getInstance();
549 549
 		$prefix = $this->_table_prefix;
550
-		if($object_id > 0) {
550
+		if ($object_id > 0) {
551 551
 			$sql = "DELETE FROM ${prefix}freetagged_objects
552 552
 				WHERE object_id = ? ";	
553 553
 				$rs = $adb->pquery($sql, array($object_id));	
@@ -574,13 +574,13 @@  discard block
 block discarded – undo
574 574
 	 */ 
575 575
 
576 576
 	public function delete_all_object_tags_for_user($tagger_id, $object_id) {
577
-		if(!isset($tagger_id)||!isset($object_id)) {
577
+		if (!isset($tagger_id) || !isset($object_id)) {
578 578
 			die("delete_all_object_tags_for_user argument missing");
579 579
 			return false;
580 580
 		}
581 581
 		$adb = PearDatabase::getInstance();
582 582
 		$prefix = $this->_table_prefix;
583
-		if($object_id > 0) {
583
+		if ($object_id > 0) {
584 584
 
585 585
 			$sql = "DELETE FROM ${prefix}freetagged_objects
586 586
 				WHERE tagger_id = ? && object_id = ?";	
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
 	 * @return string Returns the tag in normalized form.
605 605
 	 */ 
606 606
 	public function get_tag_id($tag) {
607
-		if(!isset($tag)) {
607
+		if (!isset($tag)) {
608 608
 			die("get_tag_id argument missing");
609 609
 			return false;
610 610
 		}
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
 	 */ 
633 633
 
634 634
 	public function get_raw_tag_id($tag) {
635
-		if(!isset($tag)) {
635
+		if (!isset($tag)) {
636 636
 			die("get_tag_id argument missing");
637 637
 			return false;
638 638
 		}
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 	 * @return string Returns the tag in normalized form.
666 666
 	 */
667 667
 	public function tag_object($tagger_id, $object_id, $tag_string, $module, $skip_updates = 1) {
668
-		if($tag_string == '') {
668
+		if ($tag_string == '') {
669 669
 			// If an empty string was passed, just return true, don't die.
670 670
 			// die("Empty tag string passed");
671 671
 			return true;
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 	 * @return boolean True if successful, false otherwise.
707 707
 	 */
708 708
 	public function _tag_object_array($tagger_id, $object_id, $tagArray, $module) {
709
-		foreach($tagArray as $tag) {
709
+		foreach ($tagArray as $tag) {
710 710
 			$tag = trim($tag);
711
-			if(($tag != '') && (strlen($tag) <= $this->_MAX_TAG_LENGTH)) {
712
-				if(get_magic_quotes_gpc()) {
711
+			if (($tag != '') && (strlen($tag) <= $this->_MAX_TAG_LENGTH)) {
712
+				if (get_magic_quotes_gpc()) {
713 713
 					$tag = addslashes($tag);
714 714
 				}
715 715
 				$this->safe_tag($tagger_id, $object_id, $tag, $module);
@@ -735,12 +735,12 @@  discard block
 block discarded – undo
735 735
 			return $newwords;
736 736
 		}
737 737
 		# Perform tag parsing
738
-		if(get_magic_quotes_gpc()) {
738
+		if (get_magic_quotes_gpc()) {
739 739
 			$query = stripslashes(trim($tag_string));
740 740
 		} else {
741 741
 			$query = trim($tag_string);
742 742
 		}
743
-		$words = preg_split('/(")/', $query,-1,PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
743
+		$words = preg_split('/(")/', $query, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
744 744
 		$delim = 0;
745 745
 		foreach ($words as $key => $word)
746 746
 		{
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 	public function get_most_popular_tags($tagger_id = NULL, $offset = 0, $limit = 25) {
787 787
 		$adb = PearDatabase::getInstance();
788 788
 		$params = array();
789
-		if(isset($tagger_id) && ($tagger_id > 0)) {
789
+		if (isset($tagger_id) && ($tagger_id > 0)) {
790 790
 			$tagger_sql = "AND tagger_id = ?";
791 791
 			array_push($params, $tagger_id);
792 792
 		} else {
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
 	public function count_tags($tagger_id = NULL) {
831 831
 		$adb = PearDatabase::getInstance();
832 832
 		$params = array();
833
-		if(isset($tagger_id) && ($tagger_id > 0)) {
833
+		if (isset($tagger_id) && ($tagger_id > 0)) {
834 834
 			$tagger_sql = "AND tagger_id = ?";
835 835
 			array_push($params, $tagger_id);
836 836
 		} else {
@@ -874,11 +874,11 @@  discard block
 block discarded – undo
874 874
 	 * @return string Returns an HTML snippet that can be used directly as a tag cloud.
875 875
 	 */
876 876
 
877
-	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/') {
877
+	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/') {
878 878
 		global $theme;
879
-		$theme_path="themes/".$theme."/";
880
-		$image_path=$theme_path."images/";	
881
-		$tag_list = $this->get_tag_cloud_tags($num_tags, $tagger_id,$module,$obj_id);
879
+		$theme_path = "themes/" . $theme . "/";
880
+		$image_path = $theme_path . "images/";	
881
+		$tag_list = $this->get_tag_cloud_tags($num_tags, $tagger_id, $module, $obj_id);
882 882
 		if (count($tag_list[0])) {
883 883
 			// Get the maximum qty of tagged objects in the set
884 884
 			$max_qty = max(array_values($tag_list[0]));
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 		if (0 == $spread) { // Divide by zero
895 895
 			$spread = 1;
896 896
 		}
897
-		$step = ($max_font_size - $min_font_size)/($spread);
897
+		$step = ($max_font_size - $min_font_size) / ($spread);
898 898
 
899 899
 		// Since the original tag_list is alphabetically ordered,
900 900
 		// we can now create the tag cloud by just putting a span
@@ -902,18 +902,18 @@  discard block
 block discarded – undo
902 902
 		// by $step.
903 903
 		$cloud_html = '';
904 904
 		$cloud_spans = array();
905
-		if($module =='')
905
+		if ($module == '')
906 906
 			$module = 'All';
907
-		if($module != 'All') {
907
+		if ($module != 'All') {
908 908
 			foreach ($tag_list[0] as $tag => $qty) {
909 909
 				$size = $min_font_size + ($qty - $min_qty) * $step;
910
-				$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>';
910
+				$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>';
911 911
 
912 912
 			}
913 913
 		} else {
914
-			foreach($tag_list[0] as $tag => $qty) {
914
+			foreach ($tag_list[0] as $tag => $qty) {
915 915
 				$size = $min_font_size + ($qty - $min_qty) * $step;
916
-				$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>';
916
+				$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>';
917 917
 			}
918 918
 		}
919 919
 		$cloud_html = join("\n ", $cloud_span);
@@ -938,24 +938,24 @@  discard block
 block discarded – undo
938 938
 	 * values are numeric quantity of objects tagged with that tag.
939 939
 	 */
940 940
 
941
-	public function get_tag_cloud_tags($max = 100, $tagger_id = NULL,$module = "",$obj_id = NULL) {
941
+	public function get_tag_cloud_tags($max = 100, $tagger_id = NULL, $module = "", $obj_id = NULL) {
942 942
 		$adb = PearDatabase::getInstance();
943 943
 		$params = array();
944
-		if(isset($tagger_id) && ($tagger_id > 0)) {
944
+		if (isset($tagger_id) && ($tagger_id > 0)) {
945 945
 			$tagger_sql = " && tagger_id = ?";
946 946
 			array_push($params, $tagger_id);
947 947
 		} else {
948 948
 			$tagger_sql = "";
949 949
 		}
950 950
 
951
-		if($module != "") {
951
+		if ($module != "") {
952 952
 			$tagger_sql .= " && module = ?";
953 953
 			array_push($params, $module);
954 954
 		} else {
955 955
 			$tagger_sql .= "";
956 956
 		}
957 957
 
958
-		if(isset($obj_id) && $obj_id > 0) {
958
+		if (isset($obj_id) && $obj_id > 0) {
959 959
   			$tagger_sql .= " && object_id = ?";
960 960
 			array_push($params, $obj_id);
961 961
 		} else {
@@ -978,10 +978,10 @@  discard block
 block discarded – undo
978 978
 			$retarr[$row['tag']] = $row['quantity'];
979 979
 			$retarr1[$row['tag']] = $row['tag_id'];
980 980
 		}
981
-		if($retarr) ksort($retarr);
982
-		if($retarr1) ksort($retarr1);
983
-		$return_value[]=$retarr;
984
-		$return_value[]=$retarr1;
981
+		if ($retarr) ksort($retarr);
982
+		if ($retarr1) ksort($retarr1);
983
+		$return_value[] = $retarr;
984
+		$return_value[] = $retarr1;
985 985
 		return $return_value;
986 986
 
987 987
 	}
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
 
1015 1015
 	public function similar_tags($tag, $max = 100) {
1016 1016
 		$retarr = array();
1017
-		if(!isset($tag)) {
1017
+		if (!isset($tag)) {
1018 1018
 			return $retarr;
1019 1019
 		}
1020 1020
 		$adb = PearDatabase::getInstance();
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 		$sql = "SELECT matches.object_id, COUNT( matches.object_id ) AS num_common_tags
1104 1104
 			FROM ${prefix}freetagged_objects as matches
1105 1105
 			INNER JOIN ${prefix}freetags as tags ON ( tags.id = matches.tag_id )
1106
-			WHERE tags.tag IN (". generateQuestionMarks($tagArray) .")
1106
+			WHERE tags.tag IN (" . generateQuestionMarks($tagArray) . ")
1107 1107
 			GROUP BY matches.object_id
1108 1108
 			HAVING num_common_tags >= ?
1109 1109
 			ORDER BY num_common_tags DESC
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
 		$rs = $adb->pquery($sql, array($tagArray, $threshold, $max_objects));
1113 1113
 		while ($row = $adb->fetch_array($rs)) {
1114
-			$retarr[] = array (
1114
+			$retarr[] = array(
1115 1115
 				'object_id' => $row['object_id'],
1116 1116
 				'strength' => ($row['num_common_tags'] / $numTags)
1117 1117
 				);
Please login to merge, or discard this patch.
libraries/nusoap/class.nusoap_base.php 2 patches
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 	/**
307 307
 	* gets the current debug data for this instance
308 308
 	*
309
-	* @return   debug data
309
+	* @return   string data
310 310
 	* @access   public
311 311
 	*/
312 312
 	public function &getDebug() {
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 	* gets the current debug data for this instance as an XML comment
320 320
 	* this may change the contents of the debug data
321 321
 	*
322
-	* @return   debug data as an XML comment
322
+	* @return   string data as an XML comment
323 323
 	* @access   public
324 324
 	*/
325 325
 	public function &getDebugAsXMLComment() {
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 	/**
353 353
 	* returns error string if present
354 354
 	*
355
-	* @return   mixed error string or false
355
+	* @return   string|false error string or false
356 356
 	* @access   public
357 357
 	*/
358 358
 	public function getError(){
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	/**
366 366
 	* sets error string
367 367
 	*
368
-	* @return   boolean $string error string
368
+	* @return   boolean|null $string error string
369 369
 	* @access   private
370 370
 	*/
371 371
 	public function setError($str){
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
     * returns false, if not prefixed
801 801
     *
802 802
     * @param string $str The prefixed string
803
-    * @return mixed The prefix or false if there is no prefix
803
+    * @return string|false The prefix or false if there is no prefix
804 804
     * @access public
805 805
     */
806 806
 	public function getPrefix($str){
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
     * or false if no prefixes registered for the given namespace
831 831
     *
832 832
     * @param string $ns The namespace
833
-    * @return mixed The prefix, false if the namespace has no prefixes
833
+    * @return string The prefix, false if the namespace has no prefixes
834 834
     * @access public
835 835
     */
836 836
 	public function getPrefixFromNamespace($ns) {
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 *
897 897
 * @param    int $timestamp Unix time stamp
898 898
 * @param	boolean $utc Whether the time stamp is UTC or local
899
-* @return	mixed ISO 8601 date string or false
899
+* @return	string|false ISO 8601 date string or false
900 900
 * @access   public
901 901
 */
902 902
 function timestamp_to_iso8601($timestamp,$utc=true){
Please login to merge, or discard this patch.
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -183,26 +183,26 @@  discard block
 block discarded – undo
183 183
 	*/
184 184
 	var $typemap = array(
185 185
 	'http://www.w3.org/2001/XMLSchema' => array(
186
-		'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double',
187
-		'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'',
188
-		'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string',
186
+		'string'=>'string', 'boolean'=>'boolean', 'float'=>'double', 'double'=>'double', 'decimal'=>'double',
187
+		'duration'=>'', 'dateTime'=>'string', 'time'=>'string', 'date'=>'string', 'gYearMonth'=>'',
188
+		'gYear'=>'', 'gMonthDay'=>'', 'gDay'=>'', 'gMonth'=>'', 'hexBinary'=>'string', 'base64Binary'=>'string',
189 189
 		// abstract "any" types
190
-		'anyType'=>'string','anySimpleType'=>'string',
190
+		'anyType'=>'string', 'anySimpleType'=>'string',
191 191
 		// derived datatypes
192
-		'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'',
193
-		'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer',
194
-		'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer',
195
-		'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''),
192
+		'normalizedString'=>'string', 'token'=>'string', 'language'=>'', 'NMTOKEN'=>'', 'NMTOKENS'=>'', 'Name'=>'', 'NCName'=>'', 'ID'=>'',
193
+		'IDREF'=>'', 'IDREFS'=>'', 'ENTITY'=>'', 'ENTITIES'=>'', 'integer'=>'integer', 'nonPositiveInteger'=>'integer',
194
+		'negativeInteger'=>'integer', 'long'=>'integer', 'int'=>'integer', 'short'=>'integer', 'byte'=>'integer', 'nonNegativeInteger'=>'integer',
195
+		'unsignedLong'=>'', 'unsignedInt'=>'', 'unsignedShort'=>'', 'unsignedByte'=>'', 'positiveInteger'=>''),
196 196
 	'http://www.w3.org/2000/10/XMLSchema' => array(
197
-		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
198
-		'float'=>'double','dateTime'=>'string',
199
-		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
197
+		'i4'=>'', 'int'=>'integer', 'boolean'=>'boolean', 'string'=>'string', 'double'=>'double',
198
+		'float'=>'double', 'dateTime'=>'string',
199
+		'timeInstant'=>'string', 'base64Binary'=>'string', 'base64'=>'string', 'ur-type'=>'array'),
200 200
 	'http://www.w3.org/1999/XMLSchema' => array(
201
-		'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double',
202
-		'float'=>'double','dateTime'=>'string',
203
-		'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'),
201
+		'i4'=>'', 'int'=>'integer', 'boolean'=>'boolean', 'string'=>'string', 'double'=>'double',
202
+		'float'=>'double', 'dateTime'=>'string',
203
+		'timeInstant'=>'string', 'base64Binary'=>'string', 'base64'=>'string', 'ur-type'=>'array'),
204 204
 	'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'),
205
-	'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'),
205
+	'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string', 'array'=>'array', 'Array'=>'array'),
206 206
     'http://xml.apache.org/xml-soap' => array('Map')
207 207
 	);
208 208
 
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	* @deprecated
215 215
 	* @see	expandEntities
216 216
 	*/
217
-	var $xmlEntities = array('quot' => '"','amp' => '&',
218
-		'lt' => '<','gt' => '>','apos' => "'");
217
+	var $xmlEntities = array('quot' => '"', 'amp' => '&',
218
+		'lt' => '<', 'gt' => '>', 'apos' => "'");
219 219
 
220 220
 	/**
221 221
 	* constructor
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
 	* @param    string $string debug data
273 273
 	* @access   private
274 274
 	*/
275
-	public function debug($string){
275
+	public function debug($string) {
276 276
 		if ($this->debugLevel > 0) {
277
-			$this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n");
277
+			$this->appendDebug($this->getmicrotime() . ' ' . get_class($this) . ": $string\n");
278 278
 		}
279 279
 	}
280 280
 
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	* @param    string $string debug data
285 285
 	* @access   public
286 286
 	*/
287
-	public function appendDebug($string){
287
+	public function appendDebug($string) {
288 288
 		if ($this->debugLevel > 0) {
289 289
 			// it would be nice to use a memory stream here to use
290 290
 			// memory more efficiently
@@ -355,8 +355,8 @@  discard block
 block discarded – undo
355 355
 	* @return   mixed error string or false
356 356
 	* @access   public
357 357
 	*/
358
-	public function getError(){
359
-		if($this->error_str != ''){
358
+	public function getError() {
359
+		if ($this->error_str != '') {
360 360
 			return $this->error_str;
361 361
 		}
362 362
 		return false;
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 	* @return   boolean $string error string
369 369
 	* @access   private
370 370
 	*/
371
-	public function setError($str){
371
+	public function setError($str) {
372 372
 		$this->error_str = $str;
373 373
 	}
374 374
 
@@ -404,12 +404,12 @@  discard block
 block discarded – undo
404 404
 	* @return	string	The serialized element, possibly with child elements
405 405
     * @access	public
406 406
 	*/
407
-	public function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded',$soapval=false) {
407
+	public function serialize_val($val, $name = false, $type = false, $name_ns = false, $type_ns = false, $attributes = false, $use = 'encoded', $soapval = false) {
408 408
 		$this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval");
409 409
 		$this->appendDebug('value=' . $this->varDump($val));
410 410
 		$this->appendDebug('attributes=' . $this->varDump($attributes));
411 411
 		
412
-    	if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) {
412
+    	if (is_object($val) && get_class($val) == 'soapval' && (!$soapval)) {
413 413
     		$this->debug("serialize_val: serialize soapval");
414 414
         	$xml = $val->serialize($use);
415 415
 			$this->appendDebug($val->getDebug());
@@ -420,30 +420,30 @@  discard block
 block discarded – undo
420 420
 		// force valid name if necessary
421 421
 		if (is_numeric($name)) {
422 422
 			$name = '__numeric_' . $name;
423
-		} elseif (! $name) {
423
+		} elseif (!$name) {
424 424
 			$name = 'noname';
425 425
 		}
426 426
 		// if name has ns, add ns prefix to name
427 427
 		$xmlns = '';
428
-        if($name_ns){
429
-			$prefix = 'nu'.rand(1000,9999);
430
-			$name = $prefix.':'.$name;
428
+        if ($name_ns) {
429
+			$prefix = 'nu' . rand(1000, 9999);
430
+			$name = $prefix . ':' . $name;
431 431
 			$xmlns .= " xmlns:$prefix=\"$name_ns\"";
432 432
 		}
433 433
 		// if type is prefixed, create type prefix
434
-		if($type_ns != '' && $type_ns == $this->namespaces['xsd']){
434
+		if ($type_ns != '' && $type_ns == $this->namespaces['xsd']) {
435 435
 			// need to fix this. shouldn't default to xsd if no ns specified
436 436
 		    // w/o checking against typemap
437 437
 			$type_prefix = 'xsd';
438
-		} elseif($type_ns){
439
-			$type_prefix = 'ns'.rand(1000,9999);
438
+		} elseif ($type_ns) {
439
+			$type_prefix = 'ns' . rand(1000, 9999);
440 440
 			$xmlns .= " xmlns:$type_prefix=\"$type_ns\"";
441 441
 		}
442 442
 		// serialize attributes if present
443 443
 		$atts = '';
444
-		if($attributes){
445
-			foreach($attributes as $k => $v){
446
-				$atts .= " $k=\"".$this->expandEntities($v).'"';
444
+		if ($attributes) {
445
+			foreach ($attributes as $k => $v) {
446
+				$atts .= " $k=\"" . $this->expandEntities($v) . '"';
447 447
 			}
448 448
 		}
449 449
 		// serialize null value
@@ -465,12 +465,12 @@  discard block
 block discarded – undo
465 465
         	}
466 466
 		}
467 467
         // serialize if an xsd built-in primitive type
468
-        if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){
468
+        if ($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])) {
469 469
     		$this->debug("serialize_val: serialize xsd built-in primitive type");
470 470
         	if (is_bool($val)) {
471 471
         		if ($type == 'boolean') {
472 472
 	        		$val = $val ? 'true' : 'false';
473
-	        	} elseif (! $val) {
473
+	        	} elseif (!$val) {
474 474
 	        		$val = 0;
475 475
 	        	}
476 476
 			} else if (is_string($val)) {
@@ -488,12 +488,12 @@  discard block
 block discarded – undo
488 488
         }
489 489
 		// detect type and serialize
490 490
 		$xml = '';
491
-		switch(true) {
491
+		switch (true) {
492 492
 			case (is_bool($val) || $type == 'boolean'):
493 493
 		   		$this->debug("serialize_val: serialize boolean");
494 494
         		if ($type == 'boolean') {
495 495
 	        		$val = $val ? 'true' : 'false';
496
-	        	} elseif (! $val) {
496
+	        	} elseif (!$val) {
497 497
 	        		$val = 0;
498 498
 	        	}
499 499
 				if ($use == 'literal') {
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 					$xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>";
511 511
 				}
512 512
 				break;
513
-			case (is_float($val)|| is_double($val) || $type == 'float'):
513
+			case (is_float($val) || is_double($val) || $type == 'float'):
514 514
 		   		$this->debug("serialize_val: serialize float");
515 515
 				if ($use == 'literal') {
516 516
 					$xml .= "<$name$xmlns$atts>$val</$name>";
@@ -535,17 +535,17 @@  discard block
 block discarded – undo
535 535
 					$this->appendDebug($val->getDebug());
536 536
 					$val->clearDebug();
537 537
 		        } else {
538
-					if (! $name) {
538
+					if (!$name) {
539 539
 						$name = get_class($val);
540 540
 						$this->debug("In serialize_val, used class name $name as element name");
541 541
 					} else {
542 542
 						$this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val));
543 543
 					}
544
-					foreach(get_object_vars($val) as $k => $v){
545
-						$pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use);
544
+					foreach (get_object_vars($val) as $k => $v) {
545
+						$pXml = isset($pXml) ? $pXml . $this->serialize_val($v, $k, false, false, false, false, $use) : $this->serialize_val($v, $k, false, false, false, false, $use);
546 546
 					}
547 547
 				}
548
-				if(isset($type) && isset($type_prefix)){
548
+				if (isset($type) && isset($type_prefix)) {
549 549
 					$type_str = " xsi:type=\"$type_prefix:$type\"";
550 550
 				} else {
551 551
 					$type_str = '';
@@ -560,12 +560,12 @@  discard block
 block discarded – undo
560 560
 			case (is_array($val) || $type):
561 561
 				// detect if struct or array
562 562
 				$valueType = $this->isArraySimpleOrStruct($val);
563
-                if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
563
+                if ($valueType == 'arraySimple' || preg_match('/^ArrayOf/', $type)) {
564 564
 			   		$this->debug("serialize_val: serialize array");
565 565
 					$i = 0;
566
-					if(is_array($val) && count($val)> 0){
567
-						foreach($val as $v){
568
-	                    	if(is_object($v) && get_class($v) ==  'soapval'){
566
+					if (is_array($val) && count($val) > 0) {
567
+						foreach ($val as $v) {
568
+	                    	if (is_object($v) && get_class($v) == 'soapval') {
569 569
 								$tt_ns = $v->type_ns;
570 570
 								$tt = $v->type;
571 571
 							} elseif (is_array($v)) {
@@ -574,23 +574,23 @@  discard block
 block discarded – undo
574 574
 								$tt = gettype($v);
575 575
 	                        }
576 576
 							$array_types[$tt] = 1;
577
-							$xml .= $this->serialize_val($v,'item',false,false,false,false,$use);
577
+							$xml .= $this->serialize_val($v, 'item', false, false, false, false, $use);
578 578
 							++$i;
579 579
 						}
580
-						if(count($array_types) > 1){
580
+						if (count($array_types) > 1) {
581 581
 							$array_typename = 'xsd:anyType';
582
-						} elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
582
+						} elseif (isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) {
583 583
 							if ($tt == 'integer') {
584 584
 								$tt = 'int';
585 585
 							}
586
-							$array_typename = 'xsd:'.$tt;
587
-						} elseif(isset($tt) && $tt == 'arraySimple'){
586
+							$array_typename = 'xsd:' . $tt;
587
+						} elseif (isset($tt) && $tt == 'arraySimple') {
588 588
 							$array_typename = 'SOAP-ENC:Array';
589
-						} elseif(isset($tt) && $tt == 'arrayStruct'){
589
+						} elseif (isset($tt) && $tt == 'arrayStruct') {
590 590
 							$array_typename = 'unnamed_struct_use_soapval';
591 591
 						} else {
592 592
 							// if type is prefixed, create type prefix
593
-							if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){
593
+							if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']) {
594 594
 								 $array_typename = 'xsd:' . $tt;
595 595
 							} elseif ($tt_ns) {
596 596
 								$tt_prefix = 'ns' . rand(1000, 9999);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 						} else if (isset($type) && isset($type_prefix)) {
607 607
 							$type_str = " xsi:type=\"$type_prefix:$type\"";
608 608
 						} else {
609
-							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\"";
609
+							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"" . $array_typename . "[$array_type]\"";
610 610
 						}
611 611
 					// empty array
612 612
 					} else {
@@ -618,11 +618,11 @@  discard block
 block discarded – undo
618 618
 							$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\"";
619 619
 						}
620 620
 					}
621
-					$xml = "<$name$xmlns$type_str$atts>".$xml."</$name>";
621
+					$xml = "<$name$xmlns$type_str$atts>" . $xml . "</$name>";
622 622
 				} else {
623 623
 					// got a struct
624 624
 			   		$this->debug("serialize_val: serialize struct");
625
-					if(isset($type) && isset($type_prefix)){
625
+					if (isset($type) && isset($type_prefix)) {
626 626
 						$type_str = " xsi:type=\"$type_prefix:$type\"";
627 627
 					} else {
628 628
 						$type_str = '';
@@ -632,15 +632,15 @@  discard block
 block discarded – undo
632 632
 					} else {
633 633
 						$xml .= "<$name$xmlns$type_str$atts>";
634 634
 					}
635
-					foreach($val as $k => $v){
635
+					foreach ($val as $k => $v) {
636 636
 						// Apache Map
637 637
 						if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') {
638 638
 							$xml .= '<item>';
639
-							$xml .= $this->serialize_val($k,'key',false,false,false,false,$use);
640
-							$xml .= $this->serialize_val($v,'value',false,false,false,false,$use);
639
+							$xml .= $this->serialize_val($k, 'key', false, false, false, false, $use);
640
+							$xml .= $this->serialize_val($v, 'value', false, false, false, false, $use);
641 641
 							$xml .= '</item>';
642 642
 						} else {
643
-							$xml .= $this->serialize_val($v,$k,false,false,false,false,$use);
643
+							$xml .= $this->serialize_val($v, $k, false, false, false, false, $use);
644 644
 						}
645 645
 					}
646 646
 					$xml .= "</$name>";
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 				break;
649 649
 			default:
650 650
 		   		$this->debug("serialize_val: serialize unknown");
651
-				$xml .= 'not detected, got '.gettype($val).' for '.$val;
651
+				$xml .= 'not detected, got ' . gettype($val) . ' for ' . $val;
652 652
 				break;
653 653
 		}
654 654
 		$this->debug("serialize_val returning $xml");
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
     * @return string the message
668 668
     * @access public
669 669
     */
670
-    public function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){
670
+    public function serializeEnvelope($body, $headers = false, $namespaces = array(), $style = 'rpc', $use = 'encoded', $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/') {
671 671
 
672 672
 	$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle");
673 673
 	$this->debug("headers:");
@@ -677,15 +677,15 @@  discard block
 block discarded – undo
677 677
 
678 678
 	// serialize namespaces
679 679
     $ns_string = '';
680
-	foreach(array_merge($this->namespaces,$namespaces) as $k => $v){
680
+	foreach (array_merge($this->namespaces, $namespaces) as $k => $v) {
681 681
 		$ns_string .= " xmlns:$k=\"$v\"";
682 682
 	}
683
-	if($encodingStyle) {
683
+	if ($encodingStyle) {
684 684
 		$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string";
685 685
 	}
686 686
 
687 687
 	// serialize headers
688
-	if($headers){
688
+	if ($headers) {
689 689
 		if (is_array($headers)) {
690 690
 			$xml = '';
691 691
 			foreach ($headers as $k => $v) {
@@ -698,16 +698,16 @@  discard block
 block discarded – undo
698 698
 			$headers = $xml;
699 699
 			$this->debug("In serializeEnvelope, serialized array of headers to $headers");
700 700
 		}
701
-		$headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>";
701
+		$headers = "<SOAP-ENV:Header>" . $headers . "</SOAP-ENV:Header>";
702 702
 	}
703 703
 	// serialize envelope
704 704
 	return
705
-	'<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">".
706
-	'<SOAP-ENV:Envelope'.$ns_string.">".
707
-	$headers.
708
-	"<SOAP-ENV:Body>".
709
-		$body.
710
-	"</SOAP-ENV:Body>".
705
+	'<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?' . ">" .
706
+	'<SOAP-ENV:Envelope' . $ns_string . ">" .
707
+	$headers .
708
+	"<SOAP-ENV:Body>" .
709
+		$body .
710
+	"</SOAP-ENV:Body>" .
711 711
 	"</SOAP-ENV:Envelope>";
712 712
     }
713 713
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 	 * @access public
720 720
 	 * @deprecated
721 721
 	 */
722
-    public function formatDump($str){
722
+    public function formatDump($str) {
723 723
 		$str = htmlspecialchars($str);
724 724
 		return nl2br($str);
725 725
     }
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	* @return	string contracted qname
732 732
 	* @access   private
733 733
 	*/
734
-	public function contractQname($qname){
734
+	public function contractQname($qname) {
735 735
 		// get element namespace
736 736
 		if (strrpos($qname, ':')) {
737 737
 			// get unqualified name
@@ -755,15 +755,15 @@  discard block
 block discarded – undo
755 755
 	* @return	string expanded qname
756 756
 	* @access   private
757 757
 	*/
758
-	public function expandQname($qname){
758
+	public function expandQname($qname) {
759 759
 		// get element prefix
760
-		if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
760
+		if (strpos($qname, ':') && !preg_match('/^http:\/\//', $qname)) {
761 761
 			// get unqualified name
762
-			$name = substr(strstr($qname,':'),1);
762
+			$name = substr(strstr($qname, ':'), 1);
763 763
 			// get ns prefix
764
-			$prefix = substr($qname,0,strpos($qname,':'));
765
-			if(isset($this->namespaces[$prefix])){
766
-				return $this->namespaces[$prefix].':'.$name;
764
+			$prefix = substr($qname, 0, strpos($qname, ':'));
765
+			if (isset($this->namespaces[$prefix])) {
766
+				return $this->namespaces[$prefix] . ':' . $name;
767 767
 			} else {
768 768
 				return $qname;
769 769
 			}
@@ -780,10 +780,10 @@  discard block
 block discarded – undo
780 780
     * @return string The local part
781 781
     * @access public
782 782
     */
783
-	public function getLocalPart($str){
784
-		if($sstr = strrchr($str,':')){
783
+	public function getLocalPart($str) {
784
+		if ($sstr = strrchr($str, ':')) {
785 785
 			// get unqualified name
786
-			return substr( $sstr, 1 );
786
+			return substr($sstr, 1);
787 787
 		} else {
788 788
 			return $str;
789 789
 		}
@@ -797,10 +797,10 @@  discard block
 block discarded – undo
797 797
     * @return mixed The prefix or false if there is no prefix
798 798
     * @access public
799 799
     */
800
-	public function getPrefix($str){
801
-		if($pos = strrpos($str,':')){
800
+	public function getPrefix($str) {
801
+		if ($pos = strrpos($str, ':')) {
802 802
 			// get prefix
803
-			return substr($str,0,$pos);
803
+			return substr($str, 0, $pos);
804 804
 		}
805 805
 		return false;
806 806
 	}
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
     * @return mixed The namespace, false if no namespace has the specified prefix
813 813
     * @access public
814 814
     */
815
-	public function getNamespaceFromPrefix($prefix){
815
+	public function getNamespaceFromPrefix($prefix) {
816 816
 		if (isset($this->namespaces[$prefix])) {
817 817
 			return $this->namespaces[$prefix];
818 818
 		}
@@ -893,8 +893,8 @@  discard block
 block discarded – undo
893 893
 * @return	mixed ISO 8601 date string or false
894 894
 * @access   public
895 895
 */
896
-function timestamp_to_iso8601($timestamp,$utc=true){
897
-	$datestr = date('Y-m-d\TH:i:sO',$timestamp);
896
+function timestamp_to_iso8601($timestamp, $utc = true) {
897
+	$datestr = date('Y-m-d\TH:i:sO', $timestamp);
898 898
 	$pos = strrpos($datestr, "+");
899 899
 	if ($pos === false) {
900 900
 		$pos = strrpos($datestr, "-");
@@ -904,20 +904,20 @@  discard block
 block discarded – undo
904 904
 			$datestr = substr($datestr, 0, $pos + 3) . ':' . substr($datestr, -2);
905 905
 		}
906 906
 	}
907
-	if($utc){
908
-		$pattern = '/'.
909
-		'([0-9]{4})-'.	// centuries & years CCYY-
910
-		'([0-9]{2})-'.	// months MM-
911
-		'([0-9]{2})'.	// days DD
912
-		'T'.			// separator T
913
-		'([0-9]{2}):'.	// hours hh:
914
-		'([0-9]{2}):'.	// minutes mm:
915
-		'([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
916
-		'(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
907
+	if ($utc) {
908
+		$pattern = '/' .
909
+		'([0-9]{4})-' . // centuries & years CCYY-
910
+		'([0-9]{2})-' . // months MM-
911
+		'([0-9]{2})' . // days DD
912
+		'T' . // separator T
913
+		'([0-9]{2}):' . // hours hh:
914
+		'([0-9]{2}):' . // minutes mm:
915
+		'([0-9]{2})(\.[0-9]*)?' . // seconds ss.ss...
916
+		'(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
917 917
 		'/';
918 918
 
919
-		if(preg_match($pattern,$datestr,$regs)){
920
-			return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
919
+		if (preg_match($pattern, $datestr, $regs)) {
920
+			return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ', $regs[1], $regs[2], $regs[3], $regs[4], $regs[5], $regs[6]);
921 921
 		}
922 922
 		return false;
923 923
 	} else {
@@ -932,27 +932,27 @@  discard block
 block discarded – undo
932 932
 * @return	mixed Unix timestamp (int) or false
933 933
 * @access   public
934 934
 */
935
-function iso8601_to_timestamp($datestr){
936
-	$pattern = '/'.
937
-	'([0-9]{4})-'.	// centuries & years CCYY-
938
-	'([0-9]{2})-'.	// months MM-
939
-	'([0-9]{2})'.	// days DD
940
-	'T'.			// separator T
941
-	'([0-9]{2}):'.	// hours hh:
942
-	'([0-9]{2}):'.	// minutes mm:
943
-	'([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
944
-	'(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
935
+function iso8601_to_timestamp($datestr) {
936
+	$pattern = '/' .
937
+	'([0-9]{4})-' . // centuries & years CCYY-
938
+	'([0-9]{2})-' . // months MM-
939
+	'([0-9]{2})' . // days DD
940
+	'T' . // separator T
941
+	'([0-9]{2}):' . // hours hh:
942
+	'([0-9]{2}):' . // minutes mm:
943
+	'([0-9]{2})(\.[0-9]+)?' . // seconds ss.ss...
944
+	'(Z|[+\-][0-9]{2}:?[0-9]{2})?' . // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
945 945
 	'/';
946
-	if(preg_match($pattern,$datestr,$regs)){
946
+	if (preg_match($pattern, $datestr, $regs)) {
947 947
 		// not utc
948
-		if($regs[8] != 'Z'){
949
-			$op = substr($regs[8],0,1);
950
-			$h = substr($regs[8],1,2);
951
-			$m = substr($regs[8],strlen($regs[8])-2,2);
952
-			if($op == '-'){
948
+		if ($regs[8] != 'Z') {
949
+			$op = substr($regs[8], 0, 1);
950
+			$h = substr($regs[8], 1, 2);
951
+			$m = substr($regs[8], strlen($regs[8]) - 2, 2);
952
+			if ($op == '-') {
953 953
 				$regs[4] = $regs[4] + $h;
954 954
 				$regs[5] = $regs[5] + $m;
955
-			} elseif($op == '+'){
955
+			} elseif ($op == '+') {
956 956
 				$regs[4] = $regs[4] - $h;
957 957
 				$regs[5] = $regs[5] - $m;
958 958
 			}
Please login to merge, or discard this patch.
libraries/nusoap/class.soap_fault.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     * @param string $faultcode (SOAP-ENV:Client | SOAP-ENV:Server)
44 44
     * @param string $faultactor only used when msg routed between multiple actors
45 45
     * @param string $faultstring human readable error message
46
-    * @param mixed $faultdetail detail, typically a string or array of string
46
+    * @param string $faultdetail detail, typically a string or array of string
47 47
 	*/
48 48
 	public function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
49 49
 		parent::nusoap_base();
Please login to merge, or discard this patch.
libraries/nusoap/class.soap_server.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -839,7 +839,7 @@
 block discarded – undo
839 839
 	 *
840 840
 	 * @param	array	$headers	The HTTP headers
841 841
 	 * @param	string	$data		unprocessed request data from client
842
-	 * @return	mixed	value of the message, decoded into a PHP type
842
+	 * @return	false|null	value of the message, decoded into a PHP type
843 843
 	 * @access   private
844 844
 	 */
845 845
 	public function parseRequest($headers, $data)
Please login to merge, or discard this patch.
libraries/nusoap/class.soap_val.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
 	*
64 64
 	* @param    string $name optional name
65 65
 	* @param    mixed $type optional type name
66
-	* @param	mixed $value optional value
66
+	* @param	integer $value optional value
67 67
 	* @param	mixed $element_ns optional namespace of value
68 68
 	* @param	mixed $type_ns optional namespace of type
69 69
 	* @param	mixed $attributes associative array of attributes to add to element serialization
Please login to merge, or discard this patch.
libraries/nusoap/class.wsdl.php 2 patches
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,6 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * fetches the WSDL document and parses it
89 89
 	 *
90 90
 	 * @access public
91
+	 * @param string $wsdl
91 92
 	 */
92 93
 	public function fetchWSDL($wsdl) {
93 94
 		$this->debug("parse and process WSDL path=$wsdl");
@@ -882,7 +883,7 @@  discard block
 block discarded – undo
882 883
 	/**
883 884
 	* serialize the parsed wsdl
884 885
 	*
885
-	* @param mixed $debug whether to put debug=1 in endpoint URL
886
+	* @param integer $debug whether to put debug=1 in endpoint URL
886 887
 	* @return string serialization of WSDL
887 888
 	* @access public 
888 889
 	*/
@@ -1105,7 +1106,7 @@  discard block
 block discarded – undo
1105 1106
 	 * @param string $direction (input|output)
1106 1107
 	 * @param mixed $parameters parameter value(s)
1107 1108
 	 * @param string $bindingType (soap|soap12)
1108
-	 * @return mixed parameters serialized as XML or false on error (e.g. operation not found)
1109
+	 * @return false|string parameters serialized as XML or false on error (e.g. operation not found)
1109 1110
 	 * @access public
1110 1111
 	 */
1111 1112
 	public function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') {
@@ -1205,7 +1206,7 @@  discard block
 block discarded – undo
1205 1206
 	 * @param string $operation operation name
1206 1207
 	 * @param string $direction (input|output)
1207 1208
 	 * @param mixed $parameters parameter value(s)
1208
-	 * @return mixed parameters serialized as XML or false on error (e.g. operation not found)
1209
+	 * @return false|string parameters serialized as XML or false on error (e.g. operation not found)
1209 1210
 	 * @access public
1210 1211
 	 * @deprecated
1211 1212
 	 */
Please login to merge, or discard this 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
 	var $proxypassword = '';
48 48
 	var $timeout = 0;
49 49
 	var $response_timeout = 30;
50
-	var $curl_options = array();	// User-specified cURL options
51
-	var $use_curl = false;			// whether to always try to use cURL
50
+	var $curl_options = array(); // User-specified cURL options
51
+	var $use_curl = false; // whether to always try to use cURL
52 52
 	// for HTTP authentication
53
-	var $username = '';				// Username for HTTP authentication
54
-	var $password = '';				// Password for HTTP authentication
55
-	var $authtype = '';				// Type of HTTP authentication
56
-	var $certRequest = array();		// Certificate for HTTP SSL authentication
53
+	var $username = ''; // Username for HTTP authentication
54
+	var $password = ''; // Password for HTTP authentication
55
+	var $authtype = ''; // Type of HTTP authentication
56
+	var $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.