Code Duplication    Length = 14-16 lines in 3 locations

modules/post-by-email.php 1 location

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

class.jetpack.php 2 locations

@@ 1359-1372 (lines=14) @@
1356
	/**
1357
	 * Get the wpcom user data of the current|specified connected user.
1358
	 */
1359
	public static function get_connected_user_data( $user_id = null ) {
1360
		if ( ! $user_id ) {
1361
			$user_id = get_current_user_id();
1362
		}
1363
		Jetpack::load_xml_rpc_client();
1364
		$xml = new Jetpack_IXR_Client( array(
1365
			'user_id' => $user_id,
1366
		) );
1367
		$xml->query( 'wpcom.getUser' );
1368
		if ( ! $xml->isError() ) {
1369
			return $xml->getResponse();
1370
		}
1371
		return false;
1372
	}
1373
1374
	/**
1375
	 * Get the wpcom email of the current|specified connected user.
@@ 1377-1390 (lines=14) @@
1374
	/**
1375
	 * Get the wpcom email of the current|specified connected user.
1376
	 */
1377
	public static function get_connected_user_email( $user_id = null ) {
1378
		if ( ! $user_id ) {
1379
			$user_id = get_current_user_id();
1380
		}
1381
		Jetpack::load_xml_rpc_client();
1382
		$xml = new Jetpack_IXR_Client( array(
1383
			'user_id' => $user_id,
1384
		) );
1385
		$xml->query( 'wpcom.getUserEmail' );
1386
		if ( ! $xml->isError() ) {
1387
			return $xml->getResponse();
1388
		}
1389
		return false;
1390
	}
1391
1392
	/**
1393
	 * Get the wpcom email of the master user.