Code Duplication    Length = 9-19 lines in 2 locations

class.jetpack.php 2 locations

@@ 863-881 (lines=19) @@
860
	 * @param Boolean               $is_signed      Whether the signature check has been successful.
861
	 * @param Jetpack_XMLRPC_Server $xmlrpc_server  (optional) An instance of the server to use instead of instantiating a new one.
862
	 */
863
	public function setup_xmlrpc_handlers(
864
		$request_params,
865
		$is_active,
866
		$is_signed,
867
		Jetpack_XMLRPC_Server $xmlrpc_server = null
868
	) {
869
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::setup_xmlrpc_handlers' );
870
871
		if ( ! $this->connection_manager ) {
872
			$this->connection_manager = new Connection_Manager();
873
		}
874
875
		return $this->connection_manager->setup_xmlrpc_handlers(
876
			$request_params,
877
			$is_active,
878
			$is_signed,
879
			$xmlrpc_server
880
		);
881
	}
882
883
	/**
884
	 * Initialize REST API registration connector.
@@ 5580-5588 (lines=9) @@
5577
	 * @param string         $password Password string.
5578
	 * @return \WP_User|mixed Authenticated user or error.
5579
	 */
5580
	public function authenticate_jetpack( $user, $username, $password ) {
5581
		_deprecated_function( __METHOD__, 'jetpack-7.7', 'Automattic\\Jetpack\\Connection\\Manager::authenticate_jetpack' );
5582
5583
		if ( ! $this->connection_manager ) {
5584
			$this->connection_manager = new Connection_Manager();
5585
		}
5586
5587
		return $this->connection_manager->authenticate_jetpack( $user, $username, $password );
5588
	}
5589
5590
	// Authenticates requests from Jetpack server to WP REST API endpoints.
5591
	// Uses the existing XMLRPC request signing implementation.