Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 848-866 (lines=19) @@
845
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
846
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
847
	 */
848
	public function setup_xmlrpc_handlers(
849
		$request_params,
850
		$is_active,
851
		$is_signed,
852
		Jetpack_XMLRPC_Server $xmlrpc_server = null
853
	) {
854
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
855
856
		if ( ! $this->connection_manager ) {
857
			$this->connection_manager = new Connection_Manager();
858
		}
859
860
		return $this->connection_manager->setup_xmlrpc_handlers(
861
			$request_params,
862
			$is_active,
863
			$is_signed,
864
			$xmlrpc_server
865
		);
866
	}
867
868
	/**
869
	 * Initialize REST API registration connector.
@@ 5459-5467 (lines=9) @@
5456
	 * @param string         $password Password string.
5457
	 * @return \WP_User|mixed Authenticated user or error.
5458
	 */
5459
	public function authenticate_jetpack( $user, $username, $password ) {
5460
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5461
5462
		if ( ! $this->connection_manager ) {
5463
			$this->connection_manager = new Connection_Manager();
5464
		}
5465
5466
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5467
	}
5468
5469
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5470
	// Uses the existing XMLRPC request signing implementation.