Code Duplication    Length = 14-16 lines in 3 locations

modules/post-by-email.php 1 location

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

class.jetpack.php 2 locations

@@ 1468-1481 (lines=14) @@
1465
	/**
1466
	 * Get the wpcom user data of the current|specified connected user.
1467
	 */
1468
	public static function get_connected_user_data( $user_id = null ) {
1469
		if ( ! $user_id ) {
1470
			$user_id = get_current_user_id();
1471
		}
1472
		Jetpack::load_xml_rpc_client();
1473
		$xml = new Jetpack_IXR_Client( array(
1474
			'user_id' => $user_id,
1475
		) );
1476
		$xml->query( 'wpcom.getUser' );
1477
		if ( ! $xml->isError() ) {
1478
			return $xml->getResponse();
1479
		}
1480
		return false;
1481
	}
1482
1483
	/**
1484
	 * Get the wpcom email of the current|specified connected user.
@@ 1486-1499 (lines=14) @@
1483
	/**
1484
	 * Get the wpcom email of the current|specified connected user.
1485
	 */
1486
	public static function get_connected_user_email( $user_id = null ) {
1487
		if ( ! $user_id ) {
1488
			$user_id = get_current_user_id();
1489
		}
1490
		Jetpack::load_xml_rpc_client();
1491
		$xml = new Jetpack_IXR_Client( array(
1492
			'user_id' => $user_id,
1493
		) );
1494
		$xml->query( 'wpcom.getUserEmail' );
1495
		if ( ! $xml->isError() ) {
1496
			return $xml->getResponse();
1497
		}
1498
		return false;
1499
	}
1500
1501
	/**
1502
	 * Get the wpcom email of the master user.