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

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