Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 859-877 (lines=19) @@
856
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
857
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
858
	 */
859
	public function setup_xmlrpc_handlers(
860
		$request_params,
861
		$is_active,
862
		$is_signed,
863
		Jetpack_XMLRPC_Server $xmlrpc_server = null
864
	) {
865
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
866
867
		if ( ! $this->connection_manager ) {
868
			$this->connection_manager = new Connection_Manager();
869
		}
870
871
		return $this->connection_manager->setup_xmlrpc_handlers(
872
			$request_params,
873
			$is_active,
874
			$is_signed,
875
			$xmlrpc_server
876
		);
877
	}
878
879
	/**
880
	 * Initialize REST API registration connector.
@@ 5614-5622 (lines=9) @@
5611
	 * @param string         $password Password string.
5612
	 * @return \WP_User|mixed Authenticated user or error.
5613
	 */
5614
	public function authenticate_jetpack( $user, $username, $password ) {
5615
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5616
5617
		if ( ! $this->connection_manager ) {
5618
			$this->connection_manager = new Connection_Manager();
5619
		}
5620
5621
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5622
	}
5623
5624
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5625
	// Uses the existing XMLRPC request signing implementation.