Code Duplication    Length = 4-4 lines in 2 locations

mod/web_services/start.php 2 locations

@@ 156-159 (lines=4) @@
153
	$API_METHODS[$method]["function"] = $function;
154
155
	if ($parameters != NULL) {
156
		if (!is_array($parameters)) {
157
			$msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
158
			throw new InvalidParameterException($msg);
159
		}
160
161
		// catch common mistake of not setting up param array correctly
162
		$first = current($parameters);
@@ 163-166 (lines=4) @@
160
161
		// catch common mistake of not setting up param array correctly
162
		$first = current($parameters);
163
		if (!is_array($first)) {
164
			$msg = elgg_echo('InvalidParameterException:APIParametersArrayStructure', array($method));
165
			throw new InvalidParameterException($msg);
166
		}
167
	}
168
169
	if ($parameters != NULL) {