Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

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