Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 857-875 (lines=19) @@
854
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
855
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
856
	 */
857
	public function setup_xmlrpc_handlers(
858
		$request_params,
859
		$is_active,
860
		$is_signed,
861
		Jetpack_XMLRPC_Server $xmlrpc_server = null
862
	) {
863
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
864
865
		if ( ! $this->connection_manager ) {
866
			$this->connection_manager = new Connection_Manager();
867
		}
868
869
		return $this->connection_manager->setup_xmlrpc_handlers(
870
			$request_params,
871
			$is_active,
872
			$is_signed,
873
			$xmlrpc_server
874
		);
875
	}
876
877
	/**
878
	 * Initialize REST API registration connector.
@@ 5493-5501 (lines=9) @@
5490
	 * @param string         $password Password string.
5491
	 * @return \WP_User|mixed Authenticated user or error.
5492
	 */
5493
	public function authenticate_jetpack( $user, $username, $password ) {
5494
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5495
5496
		if ( ! $this->connection_manager ) {
5497
			$this->connection_manager = new Connection_Manager();
5498
		}
5499
5500
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5501
	}
5502
5503
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5504
	// Uses the existing XMLRPC request signing implementation.