Code Duplication    Length = 14-16 lines in 3 locations

modules/post-by-email.php 1 location

@@ 137-152 (lines=16) @@
134
	<?php
135
	}
136
137
	function get_post_by_email_address() {
138
		Jetpack::load_xml_rpc_client();
139
		$xml = new Jetpack_IXR_Client( array(
140
			'user_id' => get_current_user_id(),
141
		) );
142
		$xml->query( 'jetpack.getPostByEmailAddress' );
143
144
		if ( $xml->isError() )
145
			return NULL;
146
147
		$response = $xml->getResponse();
148
		if ( empty( $response ) )
149
			return NULL;
150
151
		return $response;
152
	}
153
154
	function create_post_by_email_address() {
155
		self::__process_ajax_proxy_request(

class.jetpack.php 2 locations

@@ 1190-1203 (lines=14) @@
1187
	/**
1188
	 * Get the wpcom user data of the current|specified connected user.
1189
	 */
1190
	public static function get_connected_user_data( $user_id = null ) {
1191
		if ( ! $user_id ) {
1192
			$user_id = get_current_user_id();
1193
		}
1194
		Jetpack::load_xml_rpc_client();
1195
		$xml = new Jetpack_IXR_Client( array(
1196
			'user_id' => $user_id,
1197
		) );
1198
		$xml->query( 'wpcom.getUser' );
1199
		if ( ! $xml->isError() ) {
1200
			return $xml->getResponse();
1201
		}
1202
		return false;
1203
	}
1204
1205
	/**
1206
	 * Get the wpcom email of the current|specified connected user.
@@ 1208-1221 (lines=14) @@
1205
	/**
1206
	 * Get the wpcom email of the current|specified connected user.
1207
	 */
1208
	public static function get_connected_user_email( $user_id = null ) {
1209
		if ( ! $user_id ) {
1210
			$user_id = get_current_user_id();
1211
		}
1212
		Jetpack::load_xml_rpc_client();
1213
		$xml = new Jetpack_IXR_Client( array(
1214
			'user_id' => $user_id,
1215
		) );
1216
		$xml->query( 'wpcom.getUserEmail' );
1217
		if ( ! $xml->isError() ) {
1218
			return $xml->getResponse();
1219
		}
1220
		return false;
1221
	}
1222
1223
	/**
1224
	 * Get the wpcom email of the master user.