Code Duplication    Length = 15-15 lines in 2 locations

lib/modules/mod_xmlrpc.php 2 locations

@@ 48-62 (lines=15) @@
45
			if( is_array( $arguments ) && (sizeof($arguments) > 0) ) {
46
				while( list($key,$value) = each( $arguments ) ) {
47
					if( is_int($key) ) {
48
						switch (gettype($value)) {
49
							case ("array"):
50
								$nest_array = XMLRPC::array_encode($value);
51
								array_push($result, new XML_RPC_Value($nest_array,"array"));
52
								break;
53
							case ("integer"):
54
								array_push($result, new XML_RPC_Value($value,"int"));
55
								break;
56
							case ("string"):
57
								array_push($result, new XML_RPC_Value($value,"string"));
58
								break;
59
							default:
60
								array_push($result, new XML_RPC_Value($value));
61
								break;
62
						}
63
					} else {
64
						$pieces = explode(":",$key);
65
						if( is_array($pieces) && ( sizeof($pieces) == 1) ) { // name
@@ 66-80 (lines=15) @@
63
					} else {
64
						$pieces = explode(":",$key);
65
						if( is_array($pieces) && ( sizeof($pieces) == 1) ) { // name
66
							switch( gettype($value) ) {
67
							case ("array"):
68
								$nest_array = XMLRPC::array_encode($value);
69
								array_push($result, new XML_RPC_Value($nest_array,"array"));
70
								break;
71
							case ("integer"):
72
								array_push($result, new XML_RPC_Value($value,"int"));
73
								break;
74
							case ("string"):
75
								array_push($result, new XML_RPC_Value($value,"string"));
76
								break;
77
							default:
78
								array_push($result, new XML_RPC_Value($value));
79
								break;
80
							}
81
						} elseif( is_array($pieces) ) { // type:name
82
							$type = $pieces[0];
83
							$name = $pieces[1];