Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 873-891 (lines=19) @@
870
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
871
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
872
	 */
873
	public function setup_xmlrpc_handlers(
874
		$request_params,
875
		$is_active,
876
		$is_signed,
877
		Jetpack_XMLRPC_Server $xmlrpc_server = null
878
	) {
879
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
880
881
		if ( ! $this->connection_manager ) {
882
			$this->connection_manager = new Connection_Manager();
883
		}
884
885
		return $this->connection_manager->setup_xmlrpc_handlers(
886
			$request_params,
887
			$is_active,
888
			$is_signed,
889
			$xmlrpc_server
890
		);
891
	}
892
893
	/**
894
	 * Initialize REST API registration connector.
@@ 5484-5492 (lines=9) @@
5481
	 * @param string         $password Password string.
5482
	 * @return \WP_User|mixed Authenticated user or error.
5483
	 */
5484
	public function authenticate_jetpack( $user, $username, $password ) {
5485
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5486
5487
		if ( ! $this->connection_manager ) {
5488
			$this->connection_manager = new Connection_Manager();
5489
		}
5490
5491
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5492
	}
5493
5494
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5495
	// Uses the existing XMLRPC request signing implementation.