Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 850-868 (lines=19) @@
847
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
848
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
849
	 */
850
	public function setup_xmlrpc_handlers(
851
		$request_params,
852
		$is_active,
853
		$is_signed,
854
		Jetpack_XMLRPC_Server $xmlrpc_server = null
855
	) {
856
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
857
858
		if ( ! $this->connection_manager ) {
859
			$this->connection_manager = new Connection_Manager();
860
		}
861
862
		return $this->connection_manager->setup_xmlrpc_handlers(
863
			$request_params,
864
			$is_active,
865
			$is_signed,
866
			$xmlrpc_server
867
		);
868
	}
869
870
	/**
871
	 * Initialize REST API registration connector.
@@ 5612-5620 (lines=9) @@
5609
	 * @param string         $password Password string.
5610
	 * @return \WP_User|mixed Authenticated user or error.
5611
	 */
5612
	public function authenticate_jetpack( $user, $username, $password ) {
5613
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5614
5615
		if ( ! $this->connection_manager ) {
5616
			$this->connection_manager = new Connection_Manager();
5617
		}
5618
5619
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5620
	}
5621
5622
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5623
	// Uses the existing XMLRPC request signing implementation.