Code Duplication    Length = 20-20 lines in 2 locations

lib/xmlrpc.inc 2 locations

@@ 2920-2939 (lines=20) @@
2917
		*
2918
		* @todo add some checking for $vals to be an array of xmlrpcvals?
2919
		*/
2920
		function addArray($vals)
2921
		{
2922
			if($this->mytype==0)
2923
			{
2924
				$this->mytype=$GLOBALS['xmlrpcTypes']['array'];
2925
				$this->me['array']=$vals;
2926
				return 1;
2927
			}
2928
			elseif($this->mytype==2)
2929
			{
2930
				// we're adding to an array here
2931
				$this->me['array'] = array_merge($this->me['array'], $vals);
2932
				return 1;
2933
			}
2934
			else
2935
			{
2936
				error_log('XML-RPC: '.__METHOD__.': already initialized as a [' . $this->kindOf() . ']');
2937
				return 0;
2938
			}
2939
		}
2940
2941
		/**
2942
		* Add an array of named xmlrpcval objects to an xmlrpcval
@@ 2949-2968 (lines=20) @@
2946
		*
2947
		* @todo add some checking for $vals to be an array?
2948
		*/
2949
		function addStruct($vals)
2950
		{
2951
			if($this->mytype==0)
2952
			{
2953
				$this->mytype=$GLOBALS['xmlrpcTypes']['struct'];
2954
				$this->me['struct']=$vals;
2955
				return 1;
2956
			}
2957
			elseif($this->mytype==3)
2958
			{
2959
				// we're adding to a struct here
2960
				$this->me['struct'] = array_merge($this->me['struct'], $vals);
2961
				return 1;
2962
			}
2963
			else
2964
			{
2965
				error_log('XML-RPC: '.__METHOD__.': already initialized as a [' . $this->kindOf() . ']');
2966
				return 0;
2967
			}
2968
		}
2969
2970
		// poor man's version of print_r ???
2971
		// DEPRECATED!