Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

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