Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 863-881 (lines=19) @@
860
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
861
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
862
	 */
863
	public function setup_xmlrpc_handlers(
864
		$request_params,
865
		$is_active,
866
		$is_signed,
867
		Jetpack_XMLRPC_Server $xmlrpc_server = null
868
	) {
869
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
870
871
		if ( ! $this->connection_manager ) {
872
			$this->connection_manager = new Connection_Manager();
873
		}
874
875
		return $this->connection_manager->setup_xmlrpc_handlers(
876
			$request_params,
877
			$is_active,
878
			$is_signed,
879
			$xmlrpc_server
880
		);
881
	}
882
883
	/**
884
	 * Initialize REST API registration connector.
@@ 5555-5563 (lines=9) @@
5552
	 * @param string         $password Password string.
5553
	 * @return \WP_User|mixed Authenticated user or error.
5554
	 */
5555
	public function authenticate_jetpack( $user, $username, $password ) {
5556
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5557
5558
		if ( ! $this->connection_manager ) {
5559
			$this->connection_manager = new Connection_Manager();
5560
		}
5561
5562
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5563
	}
5564
5565
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5566
	// Uses the existing XMLRPC request signing implementation.