Code Duplication    Length = 14-16 lines in 3 locations

modules/post-by-email.php 1 location

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

class.jetpack.php 2 locations

@@ 1552-1565 (lines=14) @@
1549
	/**
1550
	 * Get the wpcom user data of the current|specified connected user.
1551
	 */
1552
	public static function get_connected_user_data( $user_id = null ) {
1553
		if ( ! $user_id ) {
1554
			$user_id = get_current_user_id();
1555
		}
1556
		Jetpack::load_xml_rpc_client();
1557
		$xml = new Jetpack_IXR_Client( array(
1558
			'user_id' => $user_id,
1559
		) );
1560
		$xml->query( 'wpcom.getUser' );
1561
		if ( ! $xml->isError() ) {
1562
			return $xml->getResponse();
1563
		}
1564
		return false;
1565
	}
1566
1567
	/**
1568
	 * Get the wpcom email of the current|specified connected user.
@@ 1570-1583 (lines=14) @@
1567
	/**
1568
	 * Get the wpcom email of the current|specified connected user.
1569
	 */
1570
	public static function get_connected_user_email( $user_id = null ) {
1571
		if ( ! $user_id ) {
1572
			$user_id = get_current_user_id();
1573
		}
1574
		Jetpack::load_xml_rpc_client();
1575
		$xml = new Jetpack_IXR_Client( array(
1576
			'user_id' => $user_id,
1577
		) );
1578
		$xml->query( 'wpcom.getUserEmail' );
1579
		if ( ! $xml->isError() ) {
1580
			return $xml->getResponse();
1581
		}
1582
		return false;
1583
	}
1584
1585
	/**
1586
	 * Get the wpcom email of the master user.