Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 986-1004 (lines=19) @@
983
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
984
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
985
	 */
986
	public function setup_xmlrpc_handlers(
987
		$request_params,
988
		$is_active,
989
		$is_signed,
990
		Jetpack_XMLRPC_Server $xmlrpc_server = null
991
	) {
992
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
993
994
		if ( ! $this->connection_manager ) {
995
			$this->connection_manager = new Connection_Manager();
996
		}
997
998
		return $this->connection_manager->setup_xmlrpc_handlers(
999
			$request_params,
1000
			$is_active,
1001
			$is_signed,
1002
			$xmlrpc_server
1003
		);
1004
	}
1005
1006
	/**
1007
	 * Used to set the list of extensions for the current environment. Extracted from class.jetpack-gutenberg.php
@@ 5669-5677 (lines=9) @@
5666
	 * @param string         $password Password string.
5667
	 * @return \WP_User|mixed Authenticated user or error.
5668
	 */
5669
	public function authenticate_jetpack( $user, $username, $password ) {
5670
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5671
5672
		if ( ! $this->connection_manager ) {
5673
			$this->connection_manager = new Connection_Manager();
5674
		}
5675
5676
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5677
	}
5678
5679
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5680
	// Uses the existing XMLRPC request signing implementation.