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

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