Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

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